Re: [PATCH] util: Remove redundant checks in the openpty()

2020-11-02 Thread Peter Maydell
On Mon, 2 Nov 2020 at 05:12, AlexChen wrote: > Thanks for your review, I will add this description to my commit message in > my patch V2. > In addition, since the amaster and the aslave are not allow to be NULL, > do we need to check that the amaster and the aslave are NULL in the beginning > of

Re: [PATCH] util: Remove redundant checks in the openpty()

2020-11-01 Thread AlexChen
On 2020/10/31 23:21, Peter Maydell wrote: > On Sat, 31 Oct 2020 at 11:04, AlexChen wrote: >> >> As we can see from the following function call stack, the amaster and the >> aslave >> cannot be NULL: char_pty_open() -> qemu_openpty_raw() -> openpty(). >> In addition, the amaster and the aslave has

Re: [PATCH] util: Remove redundant checks in the openpty()

2020-10-31 Thread Peter Maydell
On Sat, 31 Oct 2020 at 11:04, AlexChen wrote: > > As we can see from the following function call stack, the amaster and the > aslave > cannot be NULL: char_pty_open() -> qemu_openpty_raw() -> openpty(). > In addition, the amaster and the aslave has been dereferenced at the beginning > of the open

[PATCH] util: Remove redundant checks in the openpty()

2020-10-31 Thread AlexChen
As we can see from the following function call stack, the amaster and the aslave cannot be NULL: char_pty_open() -> qemu_openpty_raw() -> openpty(). In addition, the amaster and the aslave has been dereferenced at the beginning of the openpty(). So the checks on amaster and aslave in the openpty()