[PATCH] staging: rtl8192u: Add null check in rtl8192_usb_initendpoints

2020-12-26 Thread Dinghao Liu
There is an allocation for priv->rx_urb[16] has no null check, which may lead to a null pointer dereference. Signed-off-by: Dinghao Liu --- drivers/staging/rtl8192u/r8192U_core.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/stag

[PATCH] staging: fwserial: Fix error handling in fwserial_create

2020-12-21 Thread Dinghao Liu
When fw_core_add_address_handler() fails, we need to destroy the port by tty_port_destroy(). Also we need to unregister the address handler by fw_core_remove_address_handler() on failure. Signed-off-by: Dinghao Liu --- drivers/staging/fwserial/fwserial.c | 2 ++ 1 file changed, 2 insertions

[PATCH] vme: ca91cx42: fix memleak in ca91cx42_dma_list_add

2020-08-23 Thread Dinghao Liu
When we encounter invalid data width or address space, entry should be freed just like what we've done in the previous error paths. Signed-off-by: Dinghao Liu --- drivers/vme/bridges/vme_ca91cx42.c | 7 --- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/drivers/vme/bridges

[PATCH] media: atomisp: fix memleak in ia_css_stream_create

2020-08-20 Thread Dinghao Liu
When aspect_ratio_crop_init() fails, curr_stream needs to be freed just like what we've done in the following error paths. However, current code is returning directly and ends up leaking memory. Signed-off-by: Dinghao Liu --- drivers/staging/media/atomisp/pci/sh_css.c | 2 +- 1 file changed, 1

[PATCH] [v2] Staging: rtl8188eu: rtw_mlme: Fix uninitialized variable authmode

2020-07-28 Thread Dinghao Liu
river - part 4") Co-developed-by: Dan Carpenter Signed-off-by: Dan Carpenter Signed-off-by: Dinghao Liu --- Changelog: v2: - Move the initialization after 'else' statement. Refine commit message. --- drivers/staging/rtl8188eu/core/rtw_mlme.c | 4 +++- 1 file changed, 3 insert

Re: Re: [PATCH] Staging: rtl8188eu: rtw_mlme: Fix uninitialized variable authmode

2020-07-27 Thread dinghao . liu
> I review things in the order that they appear in my inbox so I hadn't > seen Greg and Larry's comments. You've now stumbled into an area of > politics where you have conflicting reviews... :P Fortunately, we're > all of us reasonable people. > > I think your patch is correct in that it is

Re: Re: [PATCH] Staging: rtl8188eu: rtw_mlme: Fix uninitialized variable authmode

2020-07-27 Thread dinghao . liu
> > Yes, in this routine, it would be possible for authmode to not be set; > however, > later code only compares it to either _WPA_IE_ID_ or _WPA2_IE_ID_. It is > never > used in a way that an unset value could make the program flow be different by > arbitrarily setting the value to zero.

[PATCH] Staging: rtl8188eu: rtw_mlme: Fix uninitialized variable authmode

2020-07-24 Thread Dinghao Liu
The variable authmode will keep uninitialized if neither if statements used to initialize this variable are not triggered. Then authmode may contain a garbage value and influence the execution flow of this function. Fix this by initializing it to zero. Signed-off-by: Dinghao Liu --- drivers

Re: Re: Re: [PATCH] [v2] media: staging: tegra-vde: fix runtime pm imbalance on error

2020-05-21 Thread dinghao . liu
Sorry, I misunderstood your idea before. A new function is the best solution for this problem. Regards, Dinghao Dan Carpenter dan.carpen...@oracle.com写道: > On Thu, May 21, 2020 at 07:42:56PM +0800, dinghao@zju.edu.cn wrote: > > We need to make sure if pm_runtime_get_sync() is designed with

Re: Re: [PATCH] [v2] media: staging: tegra-vde: fix runtime pm imbalance on error

2020-05-21 Thread dinghao . liu
Carpenter dan.carpen...@oracle.com写道: > On Thu, May 21, 2020 at 02:27:45PM +0800, Dinghao Liu wrote: > > pm_runtime_get_sync() increments the runtime PM usage counter even > > the call returns an error code. Thus a pairing decrement is needed > > on the error handling path to keep

[PATCH] [v2] media: staging: tegra-vde: fix runtime pm imbalance on error

2020-05-21 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even the call returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- Changelog: v2: - Remove unused label 'unlock' --- drivers/staging/media

Re: Re: [PATCH] media: staging: tegra-vde: fix runtime pm imbalance on error

2020-05-20 Thread dinghao . liu
rote: > > 20.05.2020 12:51, Dinghao Liu пишет: > > > pm_runtime_get_sync() increments the runtime PM usage counter even > > > it returns an error code. Thus a pairing decrement is needed on > > > the error handling path to keep the counter balanced. > > > &

[PATCH] media: staging: tegra-vde: fix runtime pm imbalance on error

2020-05-20 Thread Dinghao Liu
pm_runtime_get_sync() increments the runtime PM usage counter even it returns an error code. Thus a pairing decrement is needed on the error handling path to keep the counter balanced. Signed-off-by: Dinghao Liu --- drivers/staging/media/tegra-vde/vde.c | 2 +- 1 file changed, 1 insertion(+), 1