[PATCH] pstore: Tidy up an error check

2020-12-01 Thread Dan Carpenter
The crypto_alloc_comp() function never returns NULL, it returns error pointers on error. Signed-off-by: Dan Carpenter --- fs/pstore/platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/pstore/platform.c b/fs/pstore/platform.c index 36714df37d5d..b7a2a2a31dee 100644

Re: [PATCH 06/18] software_node: amend software_node_unregister_node_group() to perform unregistration of array in reverse order to be consistent with software_node_unregister_nodes()

2020-12-01 Thread Dan Carpenter
(attached as .config) compiler: gcc-9 (Debian 9.3.0-15) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: drivers/base/swnode.c:785 software_node_unregister_node_group() error: uninitialized symbol 'i

[PATCH v2] media: rockchip: rkisp1: remove useless debugfs checks

2020-12-01 Thread Dan Carpenter
The debugfs_create_dir() function never returns NULLs so this code will never be executed. It's not intended that callers will check for debugfs errors in the normal case and it's not necessary in this driver, so we can just delete this code. Signed-off-by: Dan Carpenter --- v2: Fix subject

Re: [PATCH] media: rockchip: rkisp1: remove some dead code

2020-12-01 Thread Dan Carpenter
On Mon, Nov 30, 2020 at 11:20:05AM -0300, Helen Koike wrote: > Hi Dan, > > Thank you for your patch. > > On 11/30/20 9:53 AM, Dan Carpenter wrote: > > The debugfs_create_dir() function never returns NULLs. It's not supposed > > to checked for errors in the norma

Re: [PATCH 000/141] Fix fall-through warnings for Clang

2020-12-01 Thread Dan Carpenter
t; case 0: > ++x; > default: > ; > } Don't warn for this. If adding a break statement changes the flow of the code then warn about potentially missing break statements, but if it doesn't change anything then don't warn about it. regards, dan carpenter

Re: [PATCH 000/141] Fix fall-through warnings for Clang

2020-12-01 Thread Dan Carpenter
ing. > > FWIW, this series has found at least one bug so far: > https://lore.kernel.org/lkml/CAFCwf11izHF=g1mGry1fE5kvFFFrxzhPSM6qKAO8gxSp=kr...@mail.gmail.com/ This is a fallthrough to a return and not to a break. That should trigger a warning. The fallthrough to a break should not generate a warning. The bug we're trying to fix is "missing break statement" but if the result of the bug is "we hit a break statement" then now we're just talking about style. GCC should limit itself to warning about potentially buggy code. regards, dan carpenter

[PATCH] bus: mhi: core: Fix error handling in mhi_register_controller()

2020-11-30 Thread Dan Carpenter
g where the goto comes from. Fixes: 8f7039787687 ("bus: mhi: core: Move to using high priority workqueue") Signed-off-by: Dan Carpenter --- drivers/bus/mhi/core/init.c | 29 ++--- 1 file changed, 14 insertions(+), 15 deletions(-) diff --git a/drivers/bus/mhi/cor

Re: [PATCH 127/141] staging: qlge: Fix fall-through warnings for Clang

2020-11-30 Thread Dan Carpenter
ate to remove the > "default" case. There are checkers which complain about that. (As a static checker developer myself, I think complaining about missing default cases is a waste of everyone's time). regards, dan carpenter

[PATCH] media: rockchip: rkisp1: remove some dead code

2020-11-30 Thread Dan Carpenter
The debugfs_create_dir() function never returns NULLs. It's not supposed to checked for errors in the normal case and there is no need to check in this function so let's just delete this dead code. Signed-off-by: Dan Carpenter --- drivers/media/platform/rockchip/rkisp1/rkisp1-dev.c | 4 1

Re: [PATCH 109/141] net: netrom: Fix fall-through warnings for Clang

2020-11-30 Thread Dan Carpenter
t->routes[1] = > t->routes[2]; > + break; > case 2: > break; > } regards, dan carpenter

Re: [PATCH] staging: mfd: hi6421-spmi-pmic: fix error return code in hi6421_spmi_pmic_probe()

2020-11-18 Thread Dan Carpenter
free_irq(pmic->irq, pmic); This free should only be done if devm_mfd_add_devices() fails. I don't know what happens if you free an IRQ which has not been requested. I think it triggers a WARN(). 316 317 return ret; 318 } regards, dan carpenter

Re: drivers/net/ethernet/freescale/gianfar.c:580 gfar_parse_group() warn: 'grp->regs' not released on lines: 517.

2020-11-16 Thread Dan Carpenter
nmap "grp->regs". > > This variable is unmapped in the caller with a wholesale cleanup function > unmap_group_regs(). Probably a false positive for smatch? > Yeah. Thanks. Smatch doesn't consider that the variable might be freed in the caller. regards, dan carpenter

Re: drivers/gpu/drm/i915/gem/i915_gem_throttle.c:59 i915_gem_throttle_ioctl() error: double locked 'ctx->engines_mutex' (orig line 59)

2020-11-16 Thread Dan Carpenter
On Mon, Nov 16, 2020 at 10:15:04AM +, Chris Wilson wrote: > Quoting Dan Carpenter (2020-11-16 10:08:38) > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git > > master > > head: 0062442ecfef0d82cd69e3e600d500

drivers/gpu/drm/i915/gem/i915_gem_throttle.c:59 i915_gem_throttle_ioctl() error: double locked 'ctx->engines_mutex' (orig line 59)

2020-11-16 Thread Dan Carpenter
as .config) compiler: gcc-9 (Debian 9.3.0-15) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: drivers/gpu/drm/i915/gem/i915_gem_throttle.c:59 i915_gem_throttle_ioctl() error: double locked 'ctx

drivers/gpu/drm/mcde/mcde_display.c:543 mcde_configure_channel() error: uninitialized symbol 'val'.

2020-11-16 Thread Dan Carpenter
(Debian 9.3.0-15) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter New smatch warnings: drivers/gpu/drm/mcde/mcde_display.c:543 mcde_configure_channel() error: uninitialized symbol 'val'. vim +/val +543 drivers/gpu

drivers/net/ethernet/freescale/gianfar.c:580 gfar_parse_group() warn: 'grp->regs' not released on lines: 517.

2020-11-16 Thread Dan Carpenter
config: powerpc64-randconfig-m031-20201113 (attached as .config) compiler: powerpc64-linux-gcc (GCC) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: drivers/net/ethernet/freescale/gianfar.c:580

drivers/mmc/host/tmio_mmc.c:177 tmio_mmc_probe() warn: argument 3 to %08lx specifier is cast from pointer

2020-11-16 Thread Dan Carpenter
) compiler: aarch64-linux-gcc (GCC) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: drivers/mmc/host/tmio_mmc.c:177 tmio_mmc_probe() warn: argument 3 to %08lx specifier is cast from pointer vim +177

Re: [bug report] sched/fair: Prefer prev cpu in asymmetric wakeup path

2020-11-13 Thread Dan Carpenter
On Fri, Nov 13, 2020 at 09:56:37AM +0100, Vincent Guittot wrote: > Hi Dan, > > Le vendredi 13 nov. 2020 à 11:46:57 (+0300), Dan Carpenter a écrit : > > Hello Vincent Guittot, > > > > The patch b4c9c9f15649: "sched/fair: Prefer prev cpu in asymmetric > >

[PATCH] clk: qcom: lpass-sc7180: Clean up on error in lpass_sc7180_init()

2020-11-13 Thread Dan Carpenter
Clean up the first driver if the second driver can't be registered. Fixes: 4ee9fe3e292b ("clk: qcom: lpass-sc7180: Disentangle the two clock devices") Signed-off-by: Dan Carpenter --- drivers/clk/qcom/lpasscorecc-sc7180.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-)

[PATCH] soc: aspeed: Fix a reference leak in aspeed_socinfo_init()

2020-11-13 Thread Dan Carpenter
This needs to call of_node_put(np) before returning if of_iomap() fails. Fixes: e0218dca5787 ("soc: aspeed: Add soc info driver") Signed-off-by: Dan Carpenter --- drivers/soc/aspeed/aspeed-socinfo.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/soc/asp

[bug report] sched/fair: Prefer prev cpu in asymmetric wakeup path

2020-11-13 Thread Dan Carpenter
util, prev)) 6258 return prev; 6259 6260 /* 6261 * Allow a per-cpu kthread to stack with the wakee if the regards, dan carpenter

[kbuild] net/core/devlink.c:4415:9: warning: Identical condition 'err', second condition is always false

2020-11-12 Thread Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 3d5e28bff7ad55aea081c1af516cc1c94a5eca7d commit: 573ed90aa5e23b512168400ba6d65e592081944e devlink: Force enclosing array on binary fmsg data compiler: riscv64-linux-gcc (GCC) 9.3.0 If you fix the issue,

Re: drivers/crypto/allwinner/sun8i-ce/sun8i-ce-hash.c:412 sun8i_ce_hash_run() warn: possible memory leak of 'result'

2020-11-11 Thread Dan Carpenter
On Wed, Nov 11, 2020 at 09:01:34AM +0100, LABBE Corentin wrote: > On Tue, Nov 10, 2020 at 01:47:37PM +0300, Dan Carpenter wrote: > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git > > master > > head: 407ab579637ced6dc32cfb2295afb7

Re: [PATCH v1 11/30] drm/tegra: dc: Support OPP and SoC core voltage scaling

2020-11-11 Thread Dan Carpenter
ot;if (ret) " will not. int var; ret = frob(); if (ret < 0) return ret; Smatch thinks positive returns are not handled so it complains that "var can be uninitialized". regards, dan carpenter

Re: [PATCH v2 3/3] media: uapi: mpeg2: Split sequence and picture parameters

2020-11-10 Thread Dan Carpenter
, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: drivers/media/v4l2-core/v4l2-ctrls.c:1809 std_validate_compound() warn: ignoring unreachable code. vim +1809 drivers/media/v4l2-core/v4l2-ctrls.c de8145452eebe55 Ezequiel Garcia

Re: [PATCH v3 00/11] Introduce Simple atomic counters

2020-11-10 Thread Dan Carpenter
get to drop a reference on an error path. Right now I just assume that anything with "error", "drop" or "->stats->" in the name is just a counter. regards, dan carpenter

drivers/crypto/allwinner/sun8i-ce/sun8i-ce-hash.c:412 sun8i_ce_hash_run() warn: possible memory leak of 'result'

2020-11-10 Thread Dan Carpenter
: gcc-9 (Debian 9.3.0-15) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: drivers/crypto/allwinner/sun8i-ce/sun8i-ce-hash.c:412 sun8i_ce_hash_run() warn: possible memory leak of 'result' vim +/result

Re: [linux-safety] [PATCH] taskstats: remove unneeded dead assignment

2020-11-10 Thread Dan Carpenter
r MIPS: > > original:- ab81d3305d578c2568fbc73aad2f9e61 kernel/taskstats.o > After your change:- ab81d3305d578c2568fbc73aad2f9e61 kernel/taskstats.o > After my change:- 0acae2c8d72abd3e15bf805fccdca711 kernel/taskstats.o I'm surprised the line numbers from the printks aren't affecting it... I personally prefer Lukas's patch. "rc" should be function scope... regards, dan carpenter

Re: [MPTCP][PATCH net 1/2] mptcp: fix static checker warnings in mptcp_pm_add_timer

2020-11-09 Thread Dan Carpenter
> > Too late. > > > > 214 return; > > 215 > > > > Fixes: 93f323b9 ("mptcp: add a new sysctl add_addr_timeout") > > Reported-by: Dan Carpenter > > Signed-off-by: Geliang Tang > > Revie

[tip: locking/urgent] futex: Don't enable IRQs unconditionally in put_pi_state()

2020-11-09 Thread tip-bot2 for Dan Carpenter
The following commit has been merged into the locking/urgent branch of tip: Commit-ID: 1e106aa3509b86738769775969822ffc1ec21bf4 Gitweb: https://git.kernel.org/tip/1e106aa3509b86738769775969822ffc1ec21bf4 Author:Dan Carpenter AuthorDate:Fri, 06 Nov 2020 11:52:05 +03:00

[kbuild] drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c:1300 create_engine_group() error: we previously assumed 'mirrored_eng_grp' could be null (see line 1256)

2020-11-09 Thread Dan Carpenter
config: x86_64-randconfig-m001-20201109 (attached as .config) compiler: gcc-9 (Debian 9.3.0-15) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter New smatch warnings: drivers/crypto/marvell/octeontx/otx_cptpf_ucode.c

Re: linux-next: Signed-off-by missing for commit in the nfsd tree

2020-11-09 Thread Dan Carpenter
; > > is missing a Signed-off-by from its author. > > I split the original patch in 2 and fixed a bug in this second patch, > but unless I hear otherwise I'll assume Dan's OK with his Signed-off-by > staying on both Yep. Thanks! Signed-off-by: Dan Carpenter regards, dan carpenter

[PATCH] auxdisplay: fix use after free in lcd2s_i2c_remove()

2020-11-06 Thread Dan Carpenter
The kfree() needs to be moved down a line to prevent a use after free. Fixes: 8c9108d014c5 ("auxdisplay: add a driver for lcd2s character display") Signed-off-by: Dan Carpenter --- drivers/auxdisplay/lcd2s.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/

[PATCH] futex: Don't enable IRQs unconditionally in put_pi_state()

2020-11-06 Thread Dan Carpenter
state() vs. exit_pi_state_list() races") Signed-off-by: Dan Carpenter --- This is from static analysis and not tested. I am not very familiar with futex code. kernel/futex.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/kernel/futex.c b/kernel/futex.c index f8

Re: [PATCH] PCI: fix a potential uninitentional integer overflow issue

2020-11-06 Thread Dan Carpenter
On Thu, Nov 05, 2020 at 04:24:30PM -0600, Bjorn Helgaas wrote: > On Wed, Oct 07, 2020 at 03:33:45PM +0300, Dan Carpenter wrote: > > On Wed, Oct 07, 2020 at 12:46:15PM +0100, Colin King wrote: > > > From: Colin Ian King > > > > > > The shift of 1 by a

Re: [v2] media: atomisp: Fix error handling path

2020-11-04 Thread Dan Carpenter
ever send it and I forget about it completely. I have currently have 740 messages in my postponed messages folder. :P That's a lot of whining and complaining which I never sent and the world is the more beautiful for it. regards, dan carpenter

Re: [PATCH v2] media: atomisp: Fix error handling path

2020-11-04 Thread Dan Carpenter
ught it didn't matter at all... regards, dan carpenter

[kbuild] Re: [PATCH] sound/core/seq: remove dead code

2020-11-03 Thread Dan Carpenter
Hi Yu, url: https://github.com/0day-ci/linux/commits/Yu-Hao/sound-core-seq-remove-dead-code/20201102-152326 base: https://git.kernel.org/pub/scm/linux/kernel/git/tiwai/sound.git for-next compiler: sparc64-linux-gcc (GCC) 9.3.0 If you fix the issue, kindly add following tag as

[kbuild] sound/soc/codecs/wcd934x.c:1571:9: warning: Identical condition 'ret', second condition is always false

2020-11-03 Thread Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: b7cbaf59f62f8ab8f157698f9e31642bff525bd0 commit: bbd7ffdbef6888459f301c5889f3b14ada38b913 clk: Allow the common clk framework to be selectable compiler: ia64-linux-gcc (GCC) 9.3.0 If you fix the issue,

drivers/net/wireless/ath/ath10k/mac.c:9125 ath10k_mac_op_set_tid_config() error: uninitialized symbol 'ret'.

2020-11-03 Thread Dan Carpenter
as .config) compiler: gcc-9 (Debian 9.3.0-15) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: drivers/net/wireless/ath/ath10k/mac.c:9125 ath10k_mac_op_set_tid_config() error: uninitialized symbol 'ret'. vim

[kbuild] Re: [PATCH] drm/irq: Add irq as false detection

2020-11-02 Thread Dan Carpenter
as .config) compiler: gcc-9 (Debian 9.3.0-15) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter New smatch warnings: drivers/gpu/drm/drm_irq.c:175 drm_irq_uninstall() warn: variable dereferenced before check 'dev' (see line 175

[kbuild] Re: [PATCH v11 09/10] fs/ntfs3: Add NTFS3 in fs/Kconfig and fs/Makefile

2020-11-02 Thread Dan Carpenter
5fc6b075e165f641fbc366b58b578055762d5f8c config: i386-randconfig-m021-20201101 (attached as .config) compiler: gcc-9 (Debian 9.3.0-15) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: fs/ntfs3/attrib.c:331

[PATCH] ide: Prevent some negative shifts in ide_set_ignore_cable()

2020-10-30 Thread Dan Carpenter
Shifting by a negative number is undefined. These values come from the module parameter, so it's not a big deal from a practical perspective. Fixes: 9fd91d959f1a ("ide: add "ignore_cable" parameter (take 2)") Signed-off-by: Dan Carpenter --- drivers/ide/ide.c | 2 +

drivers/net/wireless/intel/iwlwifi/pcie/drv.c:1049 iwl_pci_probe() warn: mask and shift to zero

2020-10-28 Thread Dan Carpenter
as .config) compiler: hppa64-linux-gcc (GCC) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter New smatch warnings: drivers/net/wireless/intel/iwlwifi/pcie/drv.c:1049 iwl_pci_probe() warn: mask and shift to zero vim +1049

Re: [RFC] wimax: move out to staging

2020-10-28 Thread Dan Carpenter
tenae with all the software on it and an ethernet cable into your house. I don't know what software the antennaes are using. Probably Linux but with an out of tree kernel module is my guess. regards, dan carpenter

[kbuild] drivers/gpu/drm/amd/amdkfd/kfd_crat.c:801:9: warning: Either the condition '!pcrat_image' is redundant or there is possible null pointer dereference: pcrat_image.

2020-10-27 Thread Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 4525c8781ec0701ce824e8bd379ae1b129e26568 commit: d0e63b343e575e8b74c185565b0d79a93494bcaa drm/amdkfd: Use kvmalloc instead of kmalloc for VCRAT compiler: powerpc64le-linux-gcc (GCC) 9.3.0 If you fix the

[kbuild] drivers/gpu/drm/aspeed/aspeed_gfx_drv.c:80:9: warning: Identical condition 'ret', second condition is always false

2020-10-27 Thread Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 4525c8781ec0701ce824e8bd379ae1b129e26568 commit: c2c25c1cf96927a0b6ddb6aaa063f1fdcc90d749 drm/aspeed: Use managed drmm_mode_config_cleanup compiler: nds32le-linux-gcc (GCC) 9.3.0 If you fix the issue,

Re: [PATCH] staging: rtl8192e, rtl8192u: use correct notation to define pointer

2020-10-27 Thread Dan Carpenter
e is really > wrong here, be careful. It's an interesting warning message. Sparse is correct that the code looks strange. If there were ever two or more elements in the array then the code would break. But since the code only uses a max of one element then it's fine. I guess the question is does this warning ever catch bugs in real life? It seems like that the kind of bug which would be caught in testing so static analysis is not going to be useful. regards, dan carpenter

drivers/tty/serial/owl-uart.c:712 owl_uart_probe() warn: 'owl_port->clk' not released on lines: 698.

2020-10-27 Thread Dan Carpenter
as .config) compiler: ia64-linux-gcc (GCC) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: drivers/tty/serial/owl-uart.c:712 owl_uart_probe() warn: 'owl_port->clk' not released on lines: 698. vim

drivers/usb/typec/tcpm/tcpci_maxim.c:324 max_tcpci_irq() error: uninitialized symbol 'irq_return'.

2020-10-27 Thread Dan Carpenter
) compiler: nios2-linux-gcc (GCC) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter New smatch warnings: drivers/usb/typec/tcpm/tcpci_maxim.c:324 max_tcpci_irq() error: uninitialized symbol 'irq_return'. drivers/usb/typec/tcpm

[kbuild] drivers/bus/mhi/core/boot.c:222:3: warning: Variable 'i' is modified but its new value is never used.

2020-10-27 Thread Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 4525c8781ec0701ce824e8bd379ae1b129e26568 commit: cd457afb16670501f00354eb0e705a7d8a50d79d bus: mhi: core: Add support for downloading firmware over BHIe compiler: powerpc64le-linux-gcc (GCC) 9.3.0 If you

drivers/phy/qualcomm/phy-qcom-qmp.c:3900 qcom_qmp_phy_probe() error: uninitialized symbol 'dp_serdes'.

2020-10-26 Thread Dan Carpenter
) compiler: gcc-9 (Debian 9.3.0-15) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter New smatch warnings: drivers/phy/qualcomm/phy-qcom-qmp.c:3900 qcom_qmp_phy_probe() error: uninitialized symbol 'dp_serdes'. Old smatch

drivers/gpu/drm/exynos/exynos_drm_dma.c:144 exynos_drm_register_dma() error: uninitialized symbol 'mapping'.

2020-10-26 Thread Dan Carpenter
(Debian 9.3.0-15) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: drivers/gpu/drm/exynos/exynos_drm_dma.c:144 exynos_drm_register_dma() error: uninitialized symbol 'mapping'. vim +/mapping +144 drivers

drivers/reset/reset-socfpga.c:67 a10_reset_init() warn: 'data->membase' not released on lines: 67.

2020-10-26 Thread Dan Carpenter
) compiler: h8300-linux-gcc (GCC) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: drivers/reset/reset-socfpga.c:67 a10_reset_init() warn: 'data->membase' not released on lines: 67. drivers/reset/re

Re: [PATCH 1/2] media: i2c: Add driver for the Sony Exmor-RS IMX300 camera sensor

2020-10-26 Thread Dan Carpenter
If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: drivers/media/i2c/imx300.c:2413 imx300_set_framefmt() error: uninitialized symbol 'ret'. vim +/ret +2413 drivers/media/i2c/imx300.c c82629fb21ade4

Re: [PATCH 12/14] media: sunxi: Add support for the A83T MIPI CSI-2 controller

2020-10-26 Thread Dan Carpenter
if (ret < 0) > + goto error_notifier_registered; > + > + return 0; > + > +error_notifier_registered: > + v4l2_async_notifier_unregister(notifier); > +error_notifier: > + v4l2_async_notifier_cleanup(notifier); > +error_media_entity: > + media_entity_cleanup(>entity); > + > + return ret; > +} regards, dan carpenter

Re: [PATCH 08/14] media: sunxi: Add support for the A31 MIPI CSI-2 controller

2020-10-26 Thread Dan Carpenter
> + > + ret = v4l2_fwnode_endpoint_parse(handle, endpoint); > + fwnode_handle_put(handle); > + if (ret) > + goto error_media_entity; > + > + /* Notifier */ > + > + v4l2_async_notifier_init(notifier); > + > + ret = v4l2_async_notifier_

Re: [PATCH] tcp: fix race condition when creating child sockets from syncookies

2020-10-26 Thread Dan Carpenter
-randconfig-m021-20201022 (attached as .config) compiler: gcc-9 (Debian 9.3.0-15) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: net/ipv4/inet_hashtables.c:570 inet_ehash_insert_chk_dup() error: uninitialized

Re: [PATCH net] net: hns3: clean up a return in hclge_tm_bp_setup()

2020-10-26 Thread Dan Carpenter
On Mon, Oct 26, 2020 at 11:18:16AM +0800, Yunsheng Lin wrote: > On 2020/10/23 19:22, Dan Carpenter wrote: > > Smatch complains that "ret" might be uninitialized if we don't enter > > the loop. We do always enter the loop so it's a false positive, but > > it's cleane

Re: [PATCH] drm/i915: Fix a crash in shmem_pin_map() error handling

2020-10-24 Thread Dan Carpenter
ize_t n_pages; > > void *vaddr; > > + int i; > > > > n_pages = file->f_mapping->host->i_size >> PAGE_SHIFT; > > pages = kvmalloc_array(n_pages, sizeof(*pages), GFP_KERNEL); > > This assumes we never have more than INT_MAX worth of pages before > a failure. Doh. Yeah. My bad. regards, dan carpenter

Re: [PATCH v2 2/2] f2fs: add F2FS_IOC_SET_COMPRESS_OPTION ioctl

2020-10-23 Thread Dan Carpenter
(Debian 9.3.0-15) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter New smatch warnings: fs/f2fs/file.c:4011 f2fs_ioc_set_compress_option() error: uninitialized symbol 'ret'. Old smatch warnings: fs/f2fs/f2fs.h:2127

[PATCH 1/2] vfio/fsl-mc: return -EFAULT if copy_to_user() fails

2020-10-23 Thread Dan Carpenter
The copy_to_user() function returns the number of bytes remaining to be copied, but this code should return -EFAULT. Fixes: df747bcd5b21 ("vfio/fsl-mc: Implement VFIO_DEVICE_GET_REGION_INFO ioctl call") Signed-off-by: Dan Carpenter --- drivers/vfio/fsl-mc/vfio_fsl_mc.c | 8 ++

[PATCH] drm/i915: Fix a crash in shmem_pin_map() error handling

2020-10-23 Thread Dan Carpenter
There is a signedness bug in shmem_pin_map() error handling because "i" is unsigned. The "while (--i >= 0)" will loop forever until the system crashes. Fixes: bfed6708d6c9 ("drm/i915: use vmap in shmem_pin_map") Signed-off-by: Dan Carpenter --- drivers/gpu/drm

[PATCH 2/2] vfio/fsl-mc: prevent underflow in vfio_fsl_mc_mmap()

2020-10-23 Thread Dan Carpenter
Fixes: 67247289688d ("vfio/fsl-mc: Allow userspace to MMAP fsl-mc device MMIO regions") Signed-off-by: Dan Carpenter --- drivers/vfio/fsl-mc/vfio_fsl_mc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vfio/fsl-mc/vfio_fsl_mc.c b/drivers/vfio/fsl-mc/vf

[PATCH net] net: hns3: clean up a return in hclge_tm_bp_setup()

2020-10-23 Thread Dan Carpenter
Smatch complains that "ret" might be uninitialized if we don't enter the loop. We do always enter the loop so it's a false positive, but it's cleaner to just return a literal zero and that silences the warning as well. Signed-off-by: Dan Carpenter --- drivers/net/ethernet/hisilicon/h

Re: [PATCH v2 2/7] staging: qlge: Initialize devlink health dump framework

2020-10-14 Thread Dan Carpenter
ore allocations, then use gotos to unwind. Ideally there would be a ql_deinit_device() function to mirror the ql_init_device() function. The ql_init_device() is staging quality code with leaks and bad label names. It should be re-written to free things one step at a time instead of calling ql_release_all(). Anyway, let's not introduce new leaks at least. regards, dan carpenter

Re: [PATCH 2/8] staging: wfx: check memory allocation

2020-10-10 Thread Dan Carpenter
On Sat, Oct 10, 2020 at 04:18:11PM +0300, Dan Carpenter wrote: > On Sat, Oct 10, 2020 at 02:07:13PM +0200, Jérôme Pouiller wrote: > > On Friday 9 October 2020 20:51:01 CEST Kalle Valo wrote: > > > CAUTION: This email originated from outside of the organization. Do not > &g

Re: [PATCH 2/8] staging: wfx: check memory allocation

2020-10-10 Thread Dan Carpenter
> dereference 'tmp_buf' > > >227 tmp_buf = kmemdup(pds->data, pds->size, GFP_KERNEL); > > >228 ret = wfx_send_pds(wdev, tmp_buf, pds->size); > > > ^^^ > > >229 kfree(tmp_buf); >

Re: [PATCH v3 2/2] power: supply: bq25790: Introduce the BQ25790 charger driver

2020-10-09 Thread Dan Carpenter
: gcc-9 (Debian 9.3.0-15) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: drivers/power/supply/bq25790_charger.c:170 bq25790_usb_work() warn: ignoring unreachable code. drivers/power/supply

[tip:x86/seves 3/75] arch/x86/kvm/svm/nested.c:1153 svm_set_nested_state() error: uninitialized symbol 'save'.

2020-10-09 Thread Dan Carpenter
as .config) compiler: gcc-9 (Debian 9.3.0-15) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: arch/x86/kvm/svm/nested.c:1153 svm_set_nested_state() error: uninitialized symbol 'save'. arch/x86/kvm/svm

Re: [PATCH v1 2/6] staging: qlge: coredump via devlink health reporter

2020-10-08 Thread Dan Carpenter
tly in the code. Don't introduce indirection if you can help it. > + int regs_num = (seg_header->seg_size - header_size) / sizeof(u32); > + int err; > + regards, dan carpenter

Re: [PATCH v1 1/6] staging: qlge: Initialize devlink health dump framework for the dlge driver

2020-10-08 Thread Dan Carpenter
uct devlink *devlink; > + struct qlge_devlink *ql_devlink; > + > + devlink = devlink_alloc(_devlink_ops, sizeof(struct qlge_devlink)); > + if (!devlink) > + return -ENOMEM; > + ql_devlink = devlink_priv(devlink); > > ndev = alloc_etherdev_mq(sizeof(struct ql_adapter), >min(MAX_CPUS, > @@ -4614,6 +4624,16 @@ static int qlge_probe(struct pci_dev *pdev, > free_netdev(ndev); > return err; > } > + > + err = devlink_register(devlink, >dev); > + if (err) { > + goto devlink_free; > + } Checkpatch warning. regards, dan carpenter

Re: [PATCH 0/7] wfx: move out from the staging area

2020-10-08 Thread Dan Carpenter
' required = '(struct ieee80211_supported_band)->n_bitrates' Some of these are unpublished checks that I haven't published because they are too crap. The rest of the email is just long explanations. Skip if not required. regards, dan carpenter #1 drivers/staging/wfx/hif_tx.c:319 hif_join() erro

Re: [PATCH] PCI: fix a potential uninitentional integer overflow issue

2020-10-07 Thread Dan Carpenter
align = BIT_ULL(align_order); "align_order" comes from sscanf() so Smatch thinks it's not trusted. Anything above 63 is undefined behavior. There should be a bounds check on this but I don't know what the valid values of "align" are. regards, dan carpenter

[kbuild] Re: [PATCH] PCI: pciehp: Add check for DL_ACTIVE bit in pciehp_check_link_status()

2020-10-07 Thread Dan Carpenter
9.3.0-15) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: drivers/pci/hotplug/pciehp_hpc.c:313 pciehp_check_link_status() warn: maybe use && instead of & vim +313 drivers/pci/hotplug/

drivers/net/ethernet/intel/ice/ice_main.c:789 ice_set_dflt_mib() warn: variable dereferenced before check 'pf' (see line 782)

2020-10-07 Thread Dan Carpenter
9.3.0-15) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: drivers/net/ethernet/intel/ice/ice_main.c:789 ice_set_dflt_mib() warn: variable dereferenced before check 'pf' (see line 782) vim +/pf +789

Re: [PATCH v3 7/7] dma-buf: system_heap: Add a system-uncached heap re-using the system heap

2020-10-07 Thread Dan Carpenter
: i386-randconfig-m021-20201002 (attached as .config) compiler: gcc-9 (Debian 9.3.0-15) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: drivers/dma-buf/heaps/system_heap.c:496 system_heap_create() warn

drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c:5638 bnx2x_link_settings_status() warn: signedness bug returning '(-22)'

2020-10-07 Thread Dan Carpenter
: gcc-9 (Debian 9.3.0-15) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter New smatch warnings: drivers/net/ethernet/broadcom/bnx2x/bnx2x_link.c:5638 bnx2x_link_settings_status() warn: signedness bug returning '(-22

Re: [PATCH v2 2/3] Input: Add Novatek NT36xxx touchscreen driver

2020-10-06 Thread Dan Carpenter
(attached as .config) compiler: gcc-9 (Debian 9.3.0-15) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: drivers/input/touchscreen/nt36xxx.c:470 nt36xxx_i2c_chip_version_init() warn: calling memset(x

Re: [PATCH][next] net: phy: dp83869: fix unsigned comparisons against less than zero values

2020-10-06 Thread Dan Carpenter
re as the previous comparison issue > reported by zero day. It was reported on Sep 25. I forward those zero day bot emails. https://lore.kernel.org/lkml/20200925123858.GX18329@kadam/ regards, dan carpenter

Re: [PATCH 2/2] media: staging: atomisp: Removed else branch in function

2020-10-06 Thread Dan Carpenter
te it like this: if (on == 0) return power_down(sd); ret = power_up(sd); if (ret) return ret; return gc0310_init(sd); regards, dan carpenter

Re: [PATCH][next] power: supply: bq25980: remove redundant zero check on ret

2020-10-06 Thread Dan Carpenter
struct bq25980_device *bq = power_supply_get_drvdata(psy); > int ret = 0; I'm surprised this doesn't generate a set but not used warning. And then at the end of the function it could be changed from "return ret;" to "return 0;" regards, dan carpenter

drivers/gpu/drm/vboxvideo/vbox_main.c:146 vbox_hw_init() warn: 'vbox->guest_heap' not released on lines: 126.

2020-10-06 Thread Dan Carpenter
(Debian 9.3.0-15) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: drivers/gpu/drm/vboxvideo/vbox_main.c:146 vbox_hw_init() warn: 'vbox->guest_heap' not released on lines: 126. vim +146 drivers/

drivers/net/ethernet/intel/i40e/i40e_debugfs.c:582 i40e_dbg_dump_desc() error: uninitialized symbol 'ring'.

2020-10-06 Thread Dan Carpenter
-9 (Debian 9.3.0-15) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: drivers/net/ethernet/intel/i40e/i40e_debugfs.c:582 i40e_dbg_dump_desc() error: uninitialized symbol 'ring'. vim +/ring +582 drivers

Re: [PATCH 00/18] use semicolons rather than commas to separate statements

2020-09-29 Thread Dan Carpenter
ommas are used deliberately to replace curly braces are just evil. Either way the code is cleaner with semi-colons. regards, dan carpenter

Re: [PATCH] staging: mfd: hi6421-spmi-pmic: Fix error return in hi6421_spmi_pmic_probe()

2020-09-29 Thread Dan Carpenter
ret = -ENOMEM; > goto irq_malloc; It shouldn't do a goto, it should just return directly. The goto releases an IRQ which isn't acquired until later in the function. regards, dan carpenter

Re: [PATCH] media: atomisp: Fixed error handling path

2020-09-29 Thread Dan Carpenter
On Tue, Sep 29, 2020 at 07:34:39AM +0530, Souptick Joarder wrote: > Hi Dan, > > > On Mon, Sep 28, 2020 at 2:08 PM Dan Carpenter > wrote: > > > > On Sun, Sep 27, 2020 at 08:38:04PM +0530, Souptick Joarder wrote: > > > Inside alloc_user_pages() based

Re: [PATCH] staging: most: don't access hdm_ch before checking it valid

2020-09-28 Thread Dan Carpenter
BUG_ON(). Checkpatch will complain about them. An Oops gives basically the same information as a BUG_ON() without completely killing the kernel so just dereferencing a NULL is preferable. Finally, we can see from the callers that "hdm_ch" is never NULL. regards, dan carpenter

[PATCH] scsi: be2iscsi: Fix a theoretical leak in beiscsi_create_eqs()

2020-09-28 Thread Dan Carpenter
46 ("[SCSI] be2iscsi: Adding msix and mcc_rings V3") Signed-off-by: Dan Carpenter --- drivers/scsi/be2iscsi/be_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c index 5c3513a4b450..202ba925

Re: [PATCH] media: atomisp: Fixed error handling path

2020-09-28 Thread Dan Carpenter
gt; Fixes: 14a638ab96c5 ("media: atomisp: use pin_user_pages() for memory > allocation") > Signed-off-by: Souptick Joarder > Cc: John Hubbard > Cc: Ira Weiny > Cc: Dan Carpenter > --- > drivers/staging/media/atomisp/pci/hmm/hmm_bo.c | 13 - > 1 file changed,

drivers/phy/mediatek/phy-mtk-tphy.c:955 mtk_phy_init() warn: 'instance->da_ref_clk' not released on lines: 952.

2020-09-26 Thread Dan Carpenter
: aarch64-linux-gcc (GCC) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter New smatch warnings: drivers/phy/mediatek/phy-mtk-tphy.c:955 mtk_phy_init() warn: 'instance->da_ref_clk' not released on lines: 952. Old sma

[PATCH v3] mm/hmm/test: use after free in dmirror_allocate_chunk()

2020-09-26 Thread Dan Carpenter
t" the "devmem" pointer is either NULL or freed. Neither the allocation nor the call to request_free_mem_region() has to be done under the lock so I moved those to the start of the function. Fixes: 1f9c4bb986d9 ("mm/memremap_pages: convert to 'struct range'") Signed-of

[kbuild] Re: [PATCH net-next v4 1/2] net: phy: dp83869: support Wake on LAN

2020-09-25 Thread Dan Carpenter
as .config) compiler: gcc-9 (Debian 9.3.0-15) 9.3.0 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter New smatch warnings: drivers/net/phy/dp83869.c:205 dp83869_set_wol() warn: impossible condition '(val_rxcfg < 0) => (0-u16m

Re: [f2fs-dev] KMSAN: uninit-value in f2fs_lookup

2020-09-25 Thread Dan Carpenter
ir)->task = current; 390 return de; Which means that we return a NULL "de" and "*res_page" is uninitialized and that matches what syzbot found throug runtime testing. 391 } regards, dan carpenter

Re: [PATCH] staging: Initial driver submission for pureLiFi devices

2020-09-24 Thread Dan Carpenter
EQ_BEACON_INTERVAL_WR); > + return r; Delete the "r" variable. > +} > + > +static int hw_init(struct purelifi_chip *chip) > +{ > + return purelifi_set_beacon_interval(chip, 100, 0, 0); > +} This is a oneline function which is only called once. Move it inline. > + > +int purelifi_chip_init_hw(struct purelifi_chip *chip) > +{ > + int r; > + > + r = hw_init(chip); > + if (r) > + goto out; Just return directly. The little bunny hop doesn't add anything. > + > + print_id(chip); > +out: > + return r; > +} Anyway, those are some ideas. regards, dan carpenter

Re: [PATCH 0/3] Prevent out-of-bounds access for built-in font data buffers

2020-09-24 Thread Dan Carpenter
Smatch has a tool to show where struct members are set. `~/smatch/smatch_data/db/smdb.py where console_font height` It's not perfect and this output comes from allmodconfig on yesterday's linux-next. regards, dan carpenter drivers/video/console/vgacon.c | vgacon_init

Re: [PATCH] mm/hmm/test: use after free in dmirror_allocate_chunk()

2020-09-24 Thread Dan Carpenter
GFP_KERNEL); > > if (!new_chunks) > > Need to call mutex_unlock(>devmem_lock). > In fact, why not make this goto err_unlock and add > err_unlock: mutex_unlock() before the err_release:. Ugh... Thanks for catching that. regards, dan carpenter

[PATCH v2] mm/hmm/test: use after free in dmirror_allocate_chunk()

2020-09-24 Thread Dan Carpenter
t" the "devmem" pointer is either NULL or freed. Neither the allocation nor the call to request_free_mem_region() has to be done under the lock so I moved those to the start of the function. Fixes: b2ef9f5a5cb3 ("mm/hmm/test: add selftest driver for HMM") Signed-off-by: Da

Re: INFO: rcu detected stall in sys_exit_group (6)

2020-09-24 Thread Dan Carpenter
ap.c:3185 > > __mmput+0x113/0x370 kernel/fork.c:1076 > > exit_mm+0x4cd/0x550 kernel/exit.c:483 > > do_exit+0x576/0x1f20 kernel/exit.c:793 > > do_group_exit+0x161/0x2d0 kernel/exit.c:903 > > __do_sys_exit_group+0x13/0x20 kernel/exit.c:914 > > __se_sys_exit_group+0x10/0x10 kernel/exit.c:912 > > __x64_sys_exit_group+0x37/0x40 kernel/exit.c:912 > > do_syscall_64+0x31/0x70 arch/x86/entry/common.c:46 > > entry_SYSCALL_64_after_hwframe+0x44/0xa9 > > Hard to understand what the syzbot reported because it's been there after > 2beaf3280e57 ("sched/core: Add function to sample state of locked-down task"). > Why does it take a couple months to trigger if this is a routine test. I think this was already fix in linux-next commit 9e097980efe9 ("sched/core: Allow try_invoke_on_locked_down_task() with irqs disabled") regards, dan carpenter

[PATCH] drm/i915: Uninitialized variable in i915_gem_object_map_page()

2020-09-24 Thread Dan Carpenter
The "i" iterator is never set to zero. This probably doesn't affect testing because GCC sometimes initializes variables and also we have a new pluggin to initialize stack variables to zero. Fixes: 7edd32a9e614 ("drm/i915: use vmap in i915_gem_object_map") Signed-off-by: D

<    1   2   3   4   5   6   7   8   9   10   >