[PATCH] power: supply: rt5033_battery: Fix the usage of potential uninitialized variable

2019-10-15 Thread Yizhuo
In function rt5033_battery_get_present(), variable "val" could be uninitialized if regmap_read() returns -EINVAL. However, "val" is used to decide the return value, which is potentially unsafe. Signed-off-by: Yizhuo --- drivers/power/supply/rt5033_battery.c | 8 +++

Re: Potential uninitialized variables in power: supply: rt5033_battery:

2019-10-13 Thread Yizhuo Zhai
Hi Sebastian: Thanks for your explanation and I will send the patch accordingly. On Sun, Oct 13, 2019 at 8:12 PM Sebastian Reichel wrote: > > Hi, > > On Thu, Oct 03, 2019 at 09:21:44PM -0700, Yizhuo Zhai wrote: > > drivers/power/supply/rt5033_battery.c: &

Re: Potential NULL pointer deference in spi

2019-10-10 Thread Yizhuo Zhai
tions. On Wed, Oct 9, 2019 at 10:48 PM Eric Dumazet wrote: > > > > On 10/9/19 10:37 PM, Yizhuo Zhai wrote: > > Hi All: > > > > drivers/spi/spi.c: > > > > The function to_spi_device() could return NULL, but some callers > > in this file does not che

Re: [PATCH] staging: sm750fb: Potential uninitialized field in "pll"

2019-10-10 Thread Yizhuo Zhai
Sorry about that, let me resend it . On Thu, Oct 10, 2019 at 2:53 AM Dan Carpenter wrote: > > On Wed, Oct 09, 2019 at 09:38:08PM -0700, Yizhuo wrote: > > Inside function set_chip_clock(), struct pll is supposed to be > > initialized in sm750_calc_pll_value(), if condition >

Potential NULL pointer deference in spi

2019-10-09 Thread Yizhuo Zhai
. -- Kind Regards, Yizhuo Zhai Computer Science, Graduate Student University of California, Riverside

Potential NULL pointer deference inata: sata_rcar

2019-10-09 Thread Yizhuo Zhai
Hi All: In function sata_rcar_bmdma_fill_sg, macro for_each_sg uses sg_next(), which could return NULL as "sg", however, there's no check before dereferencing it (in sg_dma_address()), which is potentially unsafe. -- Kind Regards, Yizhuo Zhai Computer Science, Graduate Studen

Potential NULL pointer deference in iwlwifi: mvm

2019-10-09 Thread Yizhuo Zhai
(), iwl_mvm_power_configure_uapsd(), iwl_mvm_power_allow_uapsd(), etc. -- Kind Regards, Yizhuo Zhai Computer Science, Graduate Student University of California, Riverside

Potential NULL pointer deference in mm/memcontrol.c

2019-10-09 Thread Yizhuo Zhai
(), mem_cgroup_reset(), etc. -- Kind Regards, Yizhuo Zhai Computer Science, Graduate Student University of California, Riverside

Potential NULL pointer deference in RDMA

2019-10-09 Thread Yizhuo Zhai
, Yizhuo Zhai Computer Science, Graduate Student University of California, Riverside

[PATCH] staging: sm750fb: Potential uninitialized field in "pll"

2019-10-09 Thread Yizhuo
s potentially unsafe. Signed-off-by: Yizhuo --- drivers/staging/sm750fb/ddk750_chip.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/sm750fb/ddk750_chip.c b/drivers/staging/sm750fb/ddk750_chip.c index 5a317cc98a4b..31b3cf9c2d8b 100644 --- a/drivers/st

[PATCH] ocfs2:fix potential Null Ptr Dereference

2019-10-09 Thread Yizhuo
Inside function o2hb_region_blocks_store(), to_o2hb_region() could return NULL but there's no check before its dereference, which is potentially unsafe. Signed-off-by: Yizhuo --- fs/ocfs2/cluster/heartbeat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/ocfs2/cl

[PATCH] USB: core: Fix potental Null Pointer dereference

2019-10-09 Thread Yizhuo
Inside function usb_device_is_owned(), usb_hub_to_struct_hub() could return NULL but there's no check before its dereference, which is potentially unsafe. Signed-off-by: Yizhuo --- drivers/usb/core/hub.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/usb/core/

Potential uninitialized variable "reg" in clk: axi-clkgen

2019-10-09 Thread Yizhuo Zhai
his case is not easy since the error return is not an acceptable return value for axi_clkgen_recalc_rate(). -- Kind Regards, Yizhuo Zhai Computer Science, Graduate Student University of California, Riverside

Potential uninitialized variables in rtc: ds1343

2019-10-09 Thread Yizhuo Zhai
urn value -EINVAL is unacceptable for ds1343_show_glitchfilter(). -- Kind Regards, Yizhuo Zhai Computer Science, Graduate Student University of California, Riverside

Potential uninitialized variables in cfg80211

2019-10-08 Thread Yizhuo Zhai
ontrol flow, which is potentially unsafe. The patch is hard since we do not know the correct value to initialize them. -- Kind Regards, Yizhuo Zhai Computer Science, Graduate Student University of California, Riverside

[PATCH] x86/hpet: Fix uninitialized use in hpet_msi_resume()

2019-10-08 Thread Yizhuo
Inside function hpet_msi_resume(), variable "msg" could be uninitialized if irq_chip_compose_msi_msg() returns -ENOSYS. However, it is directly used in hpet_msi_write(), which is potentially unsafe. Signed-off-by: Yizhuo --- arch/x86/kernel/hpet.c | 1 + 1 file changed, 1 insertio

Potential NULL pointer deference in net: sched

2019-10-07 Thread Yizhuo Zhai
Hi All: net/sched/sch_mq.c: Inside function mq_dump_class(), mq_queue_get() could return NULL, however, the return value of dev_queue is not checked and get used. This could potentially be unsafe. -- Kind Regards, Yizhuo Zhai Computer Science, Graduate Student University of California

Potential NULL pointer deference in SFI

2019-10-07 Thread Yizhuo Zhai
Hi All: drivers/sfi/sfi_core.c: Inside function sfi_map_table(), sfi_map_memory() could return NULL, however, the return value of sfi_map_memory() is not checked and get used. This could potentially be unsafe. -- Kind Regards, Yizhuo Zhai Computer Science, Graduate Student University of

Potential NULL pointer deference in scsi

2019-10-07 Thread Yizhuo Zhai
Hi All: drivers/scsi/scsi.c: Inside function __starget_for_each_device(), dev_to_shost() could return NULL,however, the return value shost is not checked and get used. This could potentially be unsafe. -- Kind Regards, Yizhuo Zhai Computer Science, Graduate Student University of California

Potential NULL pointer deference in scsi: scsi_transport_spi

2019-10-07 Thread Yizhuo Zhai
Hi All: drivers/scsi/scsi_transport_spi.c: Inside function store_spi_transport_period(), dev_to_shost() could return NULL, however, the return value shost is not checked and get used. This could potentially be unsafe. -- Kind Regards, Yizhuo Zhai Computer Science, Graduate Student University

[PATCH] scsi_transport_sas: Potential NULL pointer deference in sas_rphy_match()

2019-10-07 Thread Yizhuo
Inside function sas_rphy_match(), dev_to_shost() could return NULL, however, the return value of dev_to_shost() is not checked and get used. This could potentially be unsafe. Signed-off-by: Yizhuo --- drivers/scsi/scsi_transport_sas.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a

Potential NULL pointer deference in iwlwifi: mvm

2019-10-07 Thread Yizhuo Zhai
, Yizhuo Zhai Computer Science, Graduate Student University of California, Riverside

Potential NULL pointer deference in iwlwifi

2019-10-07 Thread Yizhuo Zhai
, Yizhuo Zhai Computer Science, Graduate Student University of California, Riverside

Potential NULL pointer deference in cxgbit

2019-10-07 Thread Yizhuo Zhai
Hi All: drivers/target/iscsi/cxgbit/cxgbit_ddp.c: Inside function cxgbit_ddp_sgl_check(), sg_next() could return NULL, however, the return value of sg_next() is not checked and get dereferenced. This could potentially be unsafe. -- Kind Regards, Yizhuo Zhai Computer Science, Graduate Student

[PATCH] rtc: snvs: fix uninitialized usage of "lpcr" in snvs_rtc_enable()

2019-10-04 Thread Yizhuo
"lpsr" and function snvs_rtc_read_alarm() with variables "lptar", "lpsr". The patch for those two are not easy since -EINVAL is not an acceptable return value for these functions. Signed-off-by: Yizhuo --- drivers/rtc/rtc-snvs.c | 6 +- 1 file changed, 5 insertions(+), 1 deletion

Potential uninitialized variables in regulator: ltc3589

2019-10-03 Thread Yizhuo Zhai
cause the error code is out of the return type: irqreturn_t. Thanks for your time to check this case. -- Kind Regards, Yizhuo Zhai Computer Science, Graduate Student University of California, Riverside

Potential uninitialized variables in pwm: stm32-lp

2019-10-03 Thread Yizhuo Zhai
simply return -EINVAL in stm32_pwm_lp_get_state() because the return type is void. Thanks for your time to check this case. -- Kind Regards, Yizhuo Zhai Computer Science, Graduate Student University of California, Riverside

[PATCH] pwm: stm32: Fix the usage of uninitialized variable in stm32_pwm_config()

2019-10-03 Thread Yizhuo
tect_channels() with variable "ccer", but we cannot just return -EINVAL because the error code is not acceptable by the caller. Aslo, the variable "ccer" in functionstm32_pwm_detect_complementary() could also be uninitialized, since stm32_pwm_detect_complementary() returns void, the p

Potential uninitialized variables in power: supply: rt5033_battery:

2019-10-03 Thread Yizhuo Zhai
ly return -EINVAL in rt5033_battery_get_present() because it's not an acceptable return value. Thanks for your time to check this case. -- Kind Regards, Yizhuo Zhai Computer Science, Graduate Student University of California, Riverside

Potential uninitialized variables in subsys net: hisilicon

2019-10-03 Thread Yizhuo Zhai
L in hip04_reset_ppe() because the return type is void. Thanks for your time to check this case. -- Kind Regards, Yizhuo Zhai Computer Science, Graduate Student University of California, Riverside

[PATCH] regulator: max8907: Fix the usage of uninitialized variable in max8907_regulator_probe()

2019-10-03 Thread Yizhuo
Inside function max8907_regulator_probe(), variable val could be uninitialized if regmap_read() fails. However, val is used later in the if statement to decide the content written to "pmic", which is potentially unsafe. Signed-off-by: Yizhuo --- drivers/regulator/max8907-regula

Re: [PATCH] net: hisilicon: Fix usage of uninitialized variable in function mdio_sc_cfg_reg_write()

2019-10-03 Thread Yizhuo Zhai
at 2:22 PM David Miller wrote: > > From: Yizhuo > Date: Tue, 1 Oct 2019 13:24:39 -0700 > > > In function mdio_sc_cfg_reg_write(), variable "reg_value" could be > > uninitialized if regmap_read() fails. However, "reg_value" is used > > to decide the cont

[PATCH] power: supply: max17042_battery: fix some usage of uninitialized variables

2019-10-03 Thread Yizhuo
also happens in function max17042_thread_handler() but it needs more effort to patch. Signed-off-by: Yizhuo --- drivers/power/supply/max17042_battery.c | 23 +++ 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/drivers/power/supply/max17042_battery.c b/drivers

[PATCH] power: supply: max17042_battery: fix some usage of uninitialized variables

2019-10-02 Thread Yizhuo
also happens in function max17042_thread_handler() but it needs more effort to patch. Signed-off-by: Yizhuo --- drivers/power/supply/max17042_battery.c | 23 +++ 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/drivers/power/supply/max17042_battery.c b/drivers

[PATCH] power: supply: max17042_battery: fix the potential uninitialized use in max17042_write_verify_reg()

2019-10-02 Thread Yizhuo
In function max17042_write_verify_reg(), variable "read_value" could be uninitialized if regmap_read() fails. However, "read_value" is used to decide the control flow later in the if statement, which is potentially unsafe. Signed-off-by: Yizhuo --- drivers/power/supply/ma

[PATCH] net: hisilicon: Fix usage of uninitialized variable in function mdio_sc_cfg_reg_write()

2019-10-01 Thread Yizhuo
In function mdio_sc_cfg_reg_write(), variable "reg_value" could be uninitialized if regmap_read() fails. However, "reg_value" is used to decide the control flow later in the if statement, which is potentially unsafe. Signed-off-by: Yizhuo --- drivers/net/ethernet/hisi

[PATCH] iio: adc: imx25-gcq: fix uninitialized variable usage

2019-09-30 Thread Yizhuo
e same file. Signed-off-by: Yizhuo --- drivers/iio/adc/fsl-imx25-gcq.c | 13 +++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/fsl-imx25-gcq.c b/drivers/iio/adc/fsl-imx25-gcq.c index fa71489195c6..3b1e12b7c1ac 100644 --- a/drivers/iio/adc/fsl-imx25-gcq

[PATCH] iio: trigger: stm32-timer: fix the usage of uninitialized variables

2019-09-30 Thread Yizhuo
most of the uninitialized variables, but those in function stm32_tt_read_frequency() are hard to handle and need extra effot. Signed-off-by: Yizhuo --- drivers/iio/trigger/stm32-timer-trigger.c | 98 --- 1 file changed, 85 insertions(+), 13 deletions(-) diff --git a/drivers

[PATCH] iio: adc: Variables could be uninitalized if regmap_read() fails

2019-09-29 Thread Yizhuo
: Yizhuo --- drivers/iio/adc/bcm_iproc_adc.c | 45 - 1 file changed, 39 insertions(+), 6 deletions(-) diff --git a/drivers/iio/adc/bcm_iproc_adc.c b/drivers/iio/adc/bcm_iproc_adc.c index 646ebdc0a8b4..6df19ceb5ff2 100644 --- a/drivers/iio/adc/bcm_iproc_adc.c +++ b

[PATCH] regulator: pfuze100-regulator: Variable "val" in pfuze100_regulator_probe() could be uninitialized

2019-09-29 Thread Yizhuo
In function pfuze100_regulator_probe(), variable "val" could be initialized if regmap_read() fails. However, "val" is used to decide the control flow later in the if statement, which is potentially unsafe. Signed-off-by: Yizhuo --- drivers/regulator/pfuze100-regulator.c

Re: [PATCH] iio: adc: meson-saradc: Variables could be uninitalized if regmap_read() fails

2019-09-29 Thread Yizhuo Zhai
Guire wrote: > > On Fri, Sep 27, 2019 at 05:46:41PM -0700, Yizhuo wrote: > > Several functions in this file are trying to use regmap_read() to > > initialize the specific variable, however, if regmap_read() fails, > > the variable could be uninitialized but used directly,

[PATCH] iio: adc: meson-saradc: Variables could be uninitalized if regmap_read() fails

2019-09-29 Thread Yizhuo
: Yizhuo --- drivers/iio/adc/meson_saradc.c | 30 -- 1 file changed, 24 insertions(+), 6 deletions(-) diff --git a/drivers/iio/adc/meson_saradc.c b/drivers/iio/adc/meson_saradc.c index 7b28d045d271..4b6c2983ef39 100644 --- a/drivers/iio/adc/meson_saradc.c +++ b/drivers

[PATCH] iio: adc: meson-saradc: Variables could be uninitalized if regmap_read() fails

2019-09-27 Thread Yizhuo
: Yizhuo --- drivers/iio/adc/meson_saradc.c | 28 +++- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/drivers/iio/adc/meson_saradc.c b/drivers/iio/adc/meson_saradc.c index 7b28d045d271..c032a64108b4 100644 --- a/drivers/iio/adc/meson_saradc.c +++ b/drivers/iio

[PATCH] iio: adc: imx25-gcq: Variable could be uninitialized if regmap_read() fails

2019-09-27 Thread Yizhuo
e same file. Signed-off-by: Yizhuo --- drivers/iio/adc/fsl-imx25-gcq.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/drivers/iio/adc/fsl-imx25-gcq.c b/drivers/iio/adc/fsl-imx25-gcq.c index df19ecae52f7..dbf3e8e85aba 100644 --- a/drivers/iio/adc/fsl-imx25-gcq.c +

[PATCH] staging: rtl8723bs: Variable rf_type in function rtw_cfg80211_init_wiphy() could be uninitialized

2019-09-27 Thread Yizhuo
e. Signed-off-by: Yizhuo --- drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c index 9bc685632651..dd39a581b7ef 100644 ---

Re: [PATCH] regulator: pfuze100-regulator: Variable "val" in pfuze100_regulator_probe() could be uninitialized

2019-09-03 Thread Yizhuo Zhai
Thanks Mark, I will send a new patch and check the return value instead. On Tue, Sep 3, 2019 at 4:26 AM Mark Brown wrote: > > On Mon, Sep 02, 2019 at 03:10:47PM -0700, Yizhuo wrote: > > In function pfuze100_regulator_probe(), variable "val" could be > > initia

Re: [PATCH] clocksource: atmel-st: Variable sr in at91rm9200_timer_interrupt() could be uninitialized

2019-09-02 Thread Yizhuo Zhai
and return error code if "val" is not initialized. The caller remap_read() returns the same error code, but at91rm9200_timer_interrupt() does not use this information. On Mon, Sep 2, 2019 at 3:37 PM Alexandre Belloni wrote: > > On 02/09/2019 15:29:46-0700, Yizhuo wrote: > > Inside fun

Re: [PATCH] extcon: axp288: Variable "val" could be uninitialized if regmap_read() fails

2019-09-02 Thread Yizhuo Zhai
Thanks Andy, sorry for the inconvenience, I will check the log more carefully next time. On Mon, Sep 2, 2019 at 3:48 PM Andy Shevchenko wrote: > > > > On Tuesday, September 3, 2019, Yizhuo wrote: >> >> In function axp288_extcon_log_rsi(), variable "val" could

Re: [PATCH] net: hisilicon: Variable "reg_value" in function mdio_sc_cfg_reg_write() could be uninitialized

2019-09-02 Thread Yizhuo Zhai
Sorry for the inconvenience. I made some mistake here, please ignore this patch and I will submit a new one. On Mon, Sep 2, 2019 at 4:14 PM Yizhuo wrote: > > In function mdio_sc_cfg_reg_write(), variable reg_value could be > uninitialized if regmap_read() fails. However, this variable

[PATCH] net: hisilicon: Variable "reg_value" in function mdio_sc_cfg_reg_write() could be uninitialized

2019-09-02 Thread Yizhuo
In function mdio_sc_cfg_reg_write(), variable reg_value could be uninitialized if regmap_read() fails. However, this variable is used later in the if statement, which is potentially unsafe. Signed-off-by: Yizhuo --- drivers/net/ethernet/hisilicon/hns_mdio.c | 8 +++- 1 file changed, 7

[PATCH] extcon: axp288: Variable "val" could be uninitialized if regmap_read() fails

2019-09-02 Thread Yizhuo
In function axp288_extcon_log_rsi(), variable "val" could be uninitialized if regmap_read() fails. However, it's ued to decide the control flow later in the if statement, which is potentially unsafe. Signed-off-by: Yizhuo --- drivers/extcon/extcon-axp288.c | 5 + 1

[PATCH] clocksource: atmel-st: Variable sr in at91rm9200_timer_interrupt() could be uninitialized

2019-09-02 Thread Yizhuo
: Yizhuo --- drivers/clocksource/timer-atmel-st.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/clocksource/timer-atmel-st.c b/drivers/clocksource/timer-atmel-st.c index ab0aabfae5f0..061a3f27847e 100644 --- a/drivers/clocksource/timer-atmel-st.c +++ b/drivers

[PATCH] regulator: pfuze100-regulator: Variable "val" in pfuze100_regulator_probe() could be uninitialized

2019-09-02 Thread Yizhuo
In function pfuze100_regulator_probe(), variable "val" could be initialized if regmap_read() fails. However, "val" is used to decide the control flow later in the if statement, which is potentially unsafe. Signed-off-by: Yizhuo --- drivers/regulator/pfuze100-regulator.c |

[PATCH] compal-laptop: Variable "value" in function ec_read_u8() could be uninitialized

2019-09-02 Thread Yizhuo
In function ec_read_u8(), variable "value" could be uninitialized if ec_read() fails. However, "value" is returned directly and used in its callers. This is potentially unsafe. Signed-off-by: Yizhuo --- drivers/platform/x86/compal-laptop.c | 2 +- 1 file changed, 1 inse

[PATCH] net: stmmac: dwmac-sun8i: Variable "val" in function sun8i_dwmac_set_syscon() could be uninitialized

2019-08-30 Thread Yizhuo
In function sun8i_dwmac_set_syscon(), local variable "val" could be uninitialized if function regmap_field_read() returns -EINVAL. However, it will be used directly in the if statement, which is potentially unsafe. Signed-off-by: Yizhuo --- drivers/net/ethernet/stmicro/stmmac/dwmac-s

Re: [PATCH] net: stmmac: Variable "val" in function sun8i_dwmac_set_syscon() could be uninitialized

2019-08-30 Thread Yizhuo Zhai
Hi David: Thanks for your feedback, this patch should work for v4.14. On Fri, Feb 8, 2019 at 11:01 PM David Miller wrote: > > From: Yizhuo > Date: Thu, 7 Feb 2019 09:46:23 -0800 > > > In function sun8i_dwmac_set_syscon(), local variable "val" could >

Re: [PATCH] mm/memcg: return value of the function mem_cgroup_from_css() is not checked

2019-08-30 Thread Yizhuo Zhai
Our tool did not trace back the whole path, so, now we could say it might happen. On Thu, Aug 22, 2019 at 1:12 PM Michal Hocko wrote: > > On Thu 22-08-19 13:07:17, Yizhuo Zhai wrote: > > This will happen if variable "wb->memcg_css" is NULL. This case is reported

[PATCH] drm/amd/powerplay: Variable ps could be NULL when it get dereferenced

2019-08-29 Thread Yizhuo
Inside function cz_get_performance_level(), pointer ps could be NULL via cast_const_PhwCzPowerState(). However, this pointer is dereferenced without any check, which is potentially unsafe. Signed-off-by: Yizhuo --- drivers/gpu/drm/amd/powerplay/hwmgr/cz_hwmgr.c | 3 +++ 1 file changed, 3

[PATCH] [media] drivers/media/pci: Variable vbi.type could be uninitialized if macro v4l2_subdev_call set __result an error code

2019-08-29 Thread Yizhuo
Inside function compress_sliced_buf(), variable vbi.type is uninitialized if macro v4l2_subdev_call set __result an error code. However, vbi.type is used in the if statement without any check, which is potentially unsafe. Signed-off-by: Yizhuo --- drivers/media/pci/ivtv/ivtv-vbi.c | 2 +- 1

[PATCH] kernel/smp: Variable nr_cpus is uninitialized if get_option() returns 0

2019-08-29 Thread Yizhuo
Inside function nrcpus(), variable nr_cpus is uninitialized if get_option() returns 0. However, the value will be used in the if statement, which is potentially unsafe. Signed-off-by: Yizhuo --- kernel/smp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/smp.c b

[PATCH] adfs: obj.file_id is uninitialized if __adfs_dir_get() returns error code

2019-08-28 Thread Yizhuo
Inside function adfs_dir_find_entry(), obj.file_id could be uninitialized if __adfs_dir_get() returns error code. However, the return check cannot promise the initialization of obj.file_id, which is used in the if statement. This is potentially unsafe. Signed-off-by: Yizhuo --- fs/adfs/dir_f.c

[PATCH] [media] pvrusb2: qctrl.flag will be uninitlaized if cx2341x_ctrl_query() returns error code

2019-08-26 Thread Yizhuo
Inside function ctrl_cx2341x_getv4lflags(), qctrl.flag will be uninitlaized if cx2341x_ctrl_query() returns -EINVAL. However, it will be used in the later if statement, which is potentially unsafe. Signed-off-by: Yizhuo --- drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 2 +- 1 file changed, 1

Re: [PATCH] [media] pvrusb2: qctrl.flag will be uninitlaized if cx2341x_ctrl_query() returns error code

2019-08-26 Thread Yizhuo Zhai
Thanks for the correction, let me send a new patch then. On Mon, Aug 26, 2019 at 5:09 AM Hans Verkuil wrote: > > On 8/21/19 11:09 PM, Yizhuo wrote: > > Inside function ctrl_cx2341x_getv4lflags(), qctrl.flag > > will be uninitlaized if cx2341x_ctrl_query() returns -EINVAL. >

[PATCH] mm/memcg: return value of the function mem_cgroup_from_css() is not checked

2019-08-21 Thread Yizhuo
Inside function mem_cgroup_wb_domain(), the pointer memcg could be NULL via mem_cgroup_from_css(). However, this pointer is not checked and directly dereferenced in the if statement, which is potentially unsafe. Signed-off-by: Yizhuo --- mm/memcontrol.c | 2 +- 1 file changed, 1 insertion(+), 1

[PATCH] [media] pvrusb2: qctrl.flag will be uninitlaized if cx2341x_ctrl_query() returns error code

2019-08-21 Thread Yizhuo
Inside function ctrl_cx2341x_getv4lflags(), qctrl.flag will be uninitlaized if cx2341x_ctrl_query() returns -EINVAL. However, it will be used in the later if statement, which is potentially unsafe. Signed-off-by: Yizhuo --- drivers/media/usb/pvrusb2/pvrusb2-hdw.c | 1 + 1 file changed, 1

Re: [PATCH] net: stmmac: Variable "val" in function sun8i_dwmac_set_syscon() could be uninitialized

2019-02-07 Thread Yizhuo Zhai
Make sense, I will send the new patch. Thanks for the opinion. On Thu, Feb 7, 2019 at 1:25 AM Maxime Ripard wrote: > > On Wed, Feb 06, 2019 at 09:53:16PM -0800, Yizhuo Zhai wrote: > > > > > > On Wed, Feb 6, 2019 at 9:52 PM Yizhuo Zhai wrote: > > > > > &

[PATCH] net: stmmac: Variable "val" in function sun8i_dwmac_set_syscon() could be uninitialized

2019-02-07 Thread Yizhuo
In function sun8i_dwmac_set_syscon(), local variable "val" could be uninitialized if function regmap_read() returns -EINVAL. However, it will be used directly in the if statement, which is potentially unsafe. Signed-off-by: Yizhuo --- drivers/net/ethernet/stmicro/stmmac/dwmac-s

Re: [PATCH] net: stmmac: Variable "val" in function sun8i_dwmac_set_syscon() could be uninitialized

2019-02-06 Thread Yizhuo Zhai
Thanks, but why initialization matters here? Is performance the main concern? On Wed, Feb 6, 2019 at 9:52 PM Yizhuo Zhai wrote: > > Thanks, but why initialization matters here? Is performance the main concern? > > On Wed, Feb 6, 2019 at 8:17 PM David Miller wrote: >> >&g

[PATCH] phy: Variable "val" in function miphy_osc_is_ready() could be uninitialized

2019-02-05 Thread Yizhuo
In function miphy_osc_is_ready(), local variable "val" could be uninitalized. if function regmap_read() returns -EINVAL. However, this value is used in if statement. This is potentially unsafe. Signed-off-by: Yizhuo --- drivers/phy/st/phy-miphy28lp.c | 7 +-- 1 file changed, 5

[PATCH] phy: Variable "val" in function miphy_osc_is_ready() could be uninitialized

2019-02-05 Thread Yizhuo
In function miphy_osc_is_ready(), local variable "val" could be uninitalized. if function regmap_read() returns -EINVAL. However, this value is used in if statement. This is potentially unsafe. Signed-off-by: Yizhuo --- drivers/phy/st/phy-miphy28lp.c | 7 +-- 1 file changed, 5

[PATCH] phy: rockchip-typec: Variable "val" of function rockchip_usb3_phy_power_on() could be uninitialized

2019-02-05 Thread Yizhuo
In function rockchip_usb3_phy_power_on(), local variable "val" could be uninitialized if function regmap_read() returns -EINVAL. However, this value is directly used in later context. This is potentially unsafe. Signed-off-by: Yizhuo --- drivers/phy/rockchip/phy-rockchip-typec.c |

[PATCH] phy: Variable "caldone" in function rockchip_emmc_phy_power() could be uninitialized

2019-02-05 Thread Yizhuo
In function rockchip_emmc_phy_power(), local variable "caldone" could be uninitialized if function regmap_read() returns -EINVAL. However, it will be used directly in the later context, which is potentially unsafe. Signed-off-by: Yizhuo --- drivers/phy/rockchip/phy-rockchip-e

[PATCH] PHY: Variable "val" in function pistachio_usb_phy_power_on() could be uninitialized

2019-02-05 Thread Yizhuo
In function pistachio_usb_phy_power_on(), local variable "val" could be uninitialized if function regmap_read() returns -EINVAL. However, it will be used directly in the if statement, which is potentially unsafe. Signed-off-by: Yizhuo --- drivers/phy/phy-pistachio-usb.c | 8 ++

[PATCH] net: stmmac: Variable "val" in function sun8i_dwmac_set_syscon() could be uninitialized

2019-02-05 Thread Yizhuo
In function sun8i_dwmac_set_syscon(), local variable "val" could be uninitialized if function regmap_read() returns -EINVAL. However, it will be used directly in the if statement, which is potentially unsafe. Signed-off-by: Yizhuo --- drivers/net/ethernet/stmicro/stmmac/dwmac-s

[PATCH] [media] ts2020: Variable "utmp" in function ts2020_set_tuner_rf() could be uninitialized

2019-01-30 Thread Yizhuo
In function ts2020_set_tuner_rf(), local variable "utmp" could be uninitialized if function regmap_read() returns -EINVAL. However, this value is used in if statement and written to the register, which is potentially unsafe. Signed-off-by: Yizhuo --- drivers/media/dvb-frontends/ts

[PATCH] gpu: ipu-v3: Variable "val" in function ipu_prg_get_pre() could be uninitialized

2019-01-28 Thread Yizhuo
In function ipu_prg_get_pre(), local variable "val" could be uninitialized if function regmap_read() returns -EINVAL. However, this value is used in if statement. This is potentially unsafe. Signed-off-by: Yizhuo --- drivers/gpu/ipu-v3/ipu-prg.c | 8 +++- 1 file changed, 7 insert

[PATCH] drm/exynos: gsc: Variable "gscblk_cfg" in function gsc_set_gscblk_fimd_wb() could be uninitialized

2019-01-28 Thread Yizhuo
In function gsc_set_gscblk_fimd_wb(), local variable "gscblk_cfg" could be uninitialized of function regmap_read returns -EINVAL. However, this value will be write to the register after "or" operation. This is potentially unsafe. Signed-off-by: Yizhuo --- dr

[PATCH] clk: gemini: Variable "val" in function gemini_clk_probe() could be uninitialized

2019-01-26 Thread Yizhuo
In function gemini_clk_probe(), local variable "val" could be uninitialized if function regmap_read() returns -EINVAL. However, it will be used as index in the later context, which could potentially be unsafe. Signed-off-by: Yizhuo --- drivers/clk/clk-gemini.c | 10 -- 1 file

[PATCH] ARM: OMAP2+: Variable "reg" in function omap4_dsi_mux_pads() could be uninitialized

2019-01-25 Thread Yizhuo
In function omap4_dsi_mux_pads(), local variable "reg" could be uninitialized if function regmap_read() returns -EINVAL. However, it will be used directly in the later context, which is potentially unsafe. Signed-off-by: Yizhuo --- arch/arm/mach-omap2/display.c | 7 ++- 1 file

[PATCH] ASoC: rt5651: Variable "ret" in function rt5651_i2c_probe() could be uninitialized

2019-01-25 Thread Yizhuo
In function rt5651_i2c_probe(), local variable "ret" could be uninitialized if function regmap_read() returns -EINVAL. However, this value is used in if statement. This is potentially unsafe. Signed-off-by: Yizhuo --- sound/soc/codecs/rt5651.c | 6 +- 1 file changed, 5 insert

[PATCH] ASoC: rt274: Variable "buf" in function rt274_jack_detect() could be uninitialized

2019-01-07 Thread Yizhuo
ntially unsafe. Signed-off-by: Yizhuo --- sound/soc/codecs/rt274.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/rt274.c b/sound/soc/codecs/rt274.c index 8f92e5c4dd9d..332a3e955bdb 100644 --- a/sound/soc/codecs/rt274.c +++ b/sound/soc/codecs/rt274.c @

[PATCH] ASoC: rt298: Variable "val" and "buf" in rt298_jack_detect() could be uninitialized

2019-01-04 Thread Yizhuo
ld lead to undefined behavior and thus unsafe. Signed-off-by: Yizhuo --- sound/soc/codecs/rt298.c | 24 ++-- 1 file changed, 18 insertions(+), 6 deletions(-) diff --git a/sound/soc/codecs/rt298.c b/sound/soc/codecs/rt298.c index ce963768449f..7f74349c17f3 100644 --- a/sound/soc/

[PATCH] ASoC: rt274: Variable "buf" in function rt274_jack_detect() could be uninitialized

2019-01-04 Thread Yizhuo
ntially unsafe. Signed-off-by: Yizhuo --- sound/soc/codecs/rt274.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/sound/soc/codecs/rt274.c b/sound/soc/codecs/rt274.c index cd048df76232..a2c1a6df8df6 100644 --- a/sound/soc/codecs/rt274.c +++ b/sound/soc/codecs/rt274.c @

[PATCH] Variable "val" in function rt274_i2c_probe() could be uninitialized

2019-01-03 Thread Yizhuo
Inside function rt274_i2c_probe(), if regmap_read() function returns -EINVAL, then local variable "val" leaves uninitialized but used in if statement. This is potentially unsafe. Signed-off-by: Yizhuo --- sound/soc/codecs/rt274.c | 5 - 1 file changed, 4 insertions(+), 1 deletio

[PATCH] In function rt274_i2c_probe(), if the regmap_read fails. The variable "val" could leave uninitialized but used in if statement.

2019-01-02 Thread Yizhuo
Signed-off-by: Yizhuo --- sound/soc/codecs/rt274.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/sound/soc/codecs/rt274.c b/sound/soc/codecs/rt274.c index 8f92e5c4dd9d..940658cac063 100644 --- a/sound/soc/codecs/rt274.c +++ b/sound/soc/codecs/rt274.c @@ -1113,7