Re: [PATCH] leds: lp50xx: Fix an error handling path in 'lp50xx_probe_dt()'

2020-09-23 Thread Dan Carpenter
On Wed, Sep 23, 2020 at 08:49:56PM +0200, Christophe JAILLET wrote: > Le 23/09/2020 à 15:35, Dan Carpenter a écrit : > > I've added Heikki Krogerus to the CC list because my question is mostly > > about commit 59abd83672f7 ("drivers: base: Introducing software nodes

Re: [PATCH] leds: lp50xx: Fix an error handling path in 'lp50xx_probe_dt()'

2020-09-23 Thread Dan Carpenter
goto child_out; 521 } 522 i++; 523 fwnode_handle_put(child); ^ This will call software_node_put() which calls kobject_put(). 524 } 525 526

Re: [PATCH 08/10] rpmsg: core: Add RPMSG byte conversion operations

2020-09-23 Thread Dan Carpenter
issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: drivers/rpmsg/rpmsg_core.c:33 rpmsg16_to_cpu() warn: signedness bug returning '(-22)' drivers/rpmsg/rpmsg_core.c:44 cpu_to_rpmsg16() warn: signedness bug return

[PATCH v2] soc: renesas: rmobile-sysc: Fix some leaks in rmobile_init_pm_domains()

2020-09-23 Thread Dan Carpenter
This code needs to call iounmap() on one error path. Fixes: 2173fc7cb681 ("ARM: shmobile: R-Mobile: Add DT support for PM domains") Signed-off-by: Dan Carpenter --- v2: The v1 patch potentially led to a use after free. drivers/soc/renesas/rmobile-sysc.c | 1 + 1 file changed, 1

Re: [PATCH] soc: renesas: rmobile-sysc: Fix some leaks in rmobile_init_pm_domains()

2020-09-23 Thread Dan Carpenter
On Wed, Sep 23, 2020 at 11:10:17AM +0200, Geert Uytterhoeven wrote: > Hi Dan, > > On Wed, Sep 23, 2020 at 10:47 AM Dan Carpenter > wrote: > > This code needs to call iounmap() on the error paths. > > Thanks for your patch! > > > Fixes: 2ed29e15e4b2 ("AR

[PATCH] soc: renesas: rmobile-sysc: Fix some leaks in rmobile_init_pm_domains()

2020-09-23 Thread Dan Carpenter
This code needs to call iounmap() on the error paths. Fixes: 2ed29e15e4b2 ("ARM: shmobile: R-Mobile: Move pm-rmobile to drivers/soc/renesas/") Signed-off-by: Dan Carpenter --- drivers/soc/renesas/rmobile-sysc.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/soc/renes

Re: [PATCH REBASE 0/3] atomisp: Rebased fixes

2020-09-22 Thread Dan Carpenter
> > Maybe the best would be to re-send those after the merge window, when > > both patches will arrive upstream. > > > > Thanks, > > Mauro > That sounds more sensible. I've also just noticed that I introduced a bug in > the first patch when rebasing it :-/

Re: [PATCH] rapidio: fix the missed put_device() for rio_mport_add_riodev

2020-09-22 Thread Dan Carpenter
On Tue, Sep 22, 2020 at 05:19:06PM +0800, Jing Xiangfeng wrote: > > > On 2020/9/22 16:04, Dan Carpenter wrote: > > On Tue, Sep 22, 2020 at 03:25:25PM +0800, Jing Xiangfeng wrote: > > > rio_mport_add_riodev() misses to call put_device() when the device > > &g

Re: [PATCH v6 5/8] clk: clock-wizard: Add support for fractional support

2020-09-22 Thread Dan Carpenter
WZRD_DR_LOCK_BIT_MASK, > + WZRD_USEC_POLL, WZRD_TIMEOUT_POLL); Checkpatch will catch the missing space in "err= readl_". regards, dan carpenter

[PATCH] mfd: max8998: fix potential double free in probe

2020-09-22 Thread Dan Carpenter
that this patch changes is that it adds a check for if max8998_irq_init() fails. Fixes: 156f252857df ("drivers: regulator: add Maxim 8998 driver") Signed-off-by: Dan Carpenter --- Checking max8998_irq_init() is slightly risky because sometimes these functions have been failing and we didn&#

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

2020-09-22 Thread Dan Carpenter
p.range.start" 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") S

Re: [PATCH] rapidio: fix the missed put_device() for rio_mport_add_riodev

2020-09-22 Thread Dan Carpenter
On Tue, Sep 22, 2020 at 03:25:25PM +0800, Jing Xiangfeng wrote: > rio_mport_add_riodev() misses to call put_device() when the device > already exists. Add the missed function call to fix it. > Looks good. Reviewed-by: Dan Carpenter I notice that rio_mport_del_riodev() has a re

Re: [PATCH RFT/RFC 37/49] staging: media: zoran: add fallthrough keyword

2020-09-21 Thread Dan Carpenter
don't need fallthrough labels for empty switch statements like this? regards, dan carpenter

Re: [PATCH] mm/gup: protect unpin_user_pages() against npages==-ERRNO

2020-09-21 Thread Dan Carpenter
On Sat, Sep 19, 2020 at 09:13:17PM -0700, John Hubbard wrote: > On 9/19/20 8:03 PM, Souptick Joarder wrote: > > On Thu, Sep 17, 2020 at 1:11 PM Dan Carpenter > > wrote: > > > On Wed, Sep 16, 2020 at 11:57:06PM -0700, John Hubbard wrote: > > > > As

Re: [CRM114spam]: drivers/hwmon/w83627ehf.c:2417 w83627ehf_probe() warn: 'res->start' not released on lines: 2412.

2020-09-21 Thread Dan Carpenter
On Sun, Sep 20, 2020 at 06:49:54PM +0100, Dr. David Alan Gilbert wrote: > * Dan Carpenter (dan.carpen...@oracle.com) wrote: > > b84bb5186297d1 drivers/hwmon/w83627ehf.c Guenter Roeck > > 2011-02-13 2405 > > 266cd5835947d0 drivers/hwmon/w83627ehf.c D

Re: [PATCH] lib/scatterlist: Fix memory leak in sgl_alloc_order()

2020-09-21 Thread Dan Carpenter
We asked Markus over and over to stop sending these emails but he refused so eventually he had to be banned from vger. Unless you're directly mentioned in the CC list then you can't see his emails. regards, dan carpenter

Re: [PATCH] scsi: arcmsr: Remove the superfluous break

2020-09-18 Thread Dan Carpenter
Smatch just ignores these because they're often done deliberately. regards, dan carpenter

[PATCH] misc: hisi_hikey_usb: delete a stray tab

2020-09-18 Thread Dan Carpenter
This return statement is indented one tab too far. Signed-off-by: Dan Carpenter --- drivers/misc/hisi_hikey_usb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/misc/hisi_hikey_usb.c b/drivers/misc/hisi_hikey_usb.c index 2ddd4072788d..0913509d2628 100644 --- a

Re: [PATCH] regmap: debugfs: Add back in erroneously removed initialisation of ret

2020-09-18 Thread Dan Carpenter
On Fri, Sep 18, 2020 at 12:20:02PM +0100, Charles Keepax wrote: > Fixes: 94cc89eb8fa5 ("regmap: debugfs: Fix handling of name string for > debugfs init delays") > Reported-by: kernel test robot > Reported-by: Dan Carpenter > Signed-off-by: Charles Keepax > --- >

Re: [RFC PATCH] Add bridge driver to connect sensors to CIO2 device via software nodes on ACPI platforms

2020-09-18 Thread Dan Carpenter
On Fri, Sep 18, 2020 at 09:40:43AM +0300, Sakari Ailus wrote: > Hi Dan, > > On Thu, Sep 17, 2020 at 01:49:41PM +0300, Dan Carpenter wrote: > > On Thu, Sep 17, 2020 at 01:33:43PM +0300, Sakari Ailus wrote: > > > > +static int connect_supported_devices(void) > &

Re: [RFC PATCH] Add bridge driver to connect sensors to CIO2 device via software nodes on ACPI platforms

2020-09-18 Thread Dan Carpenter
> + struct fwnode_handle *fwnode; > +}; > + nodes[SWNODE_NULL_TERMINATOR] = SOFTWARE_NODE_NULL; ^^^^^^^^ Here. regards, dan carpenter

Re: [linux-next PATCH] rapidio: Fix error handling path

2020-09-17 Thread Dan Carpenter
On Fri, Sep 18, 2020 at 07:55:05AM +0530, Souptick Joarder wrote: > Hi Dan, > > On Thu, Sep 17, 2020 at 6:10 PM Dan Carpenter > wrote: > > > > On Wed, Sep 16, 2020 at 01:02:32PM +0300, Dan Carpenter wrote: > > > On Wed, Sep 16, 2020 at 09:12:17AM +0530, Souptic

Re: [RFC PATCH] Add bridge driver to connect sensors to CIO2 device via software nodes on ACPI platforms

2020-09-17 Thread Dan Carpenter
On Thu, Sep 17, 2020 at 03:25:29PM +0300, Andy Shevchenko wrote: > On Thu, Sep 17, 2020 at 01:49:41PM +0300, Dan Carpenter wrote: > > On Thu, Sep 17, 2020 at 01:33:43PM +0300, Sakari Ailus wrote: > > > > > + int i, ret; > > > > > > unsigned in

Re: [linux-next PATCH] rapidio: Fix error handling path

2020-09-17 Thread Dan Carpenter
On Wed, Sep 16, 2020 at 01:02:32PM +0300, Dan Carpenter wrote: > On Wed, Sep 16, 2020 at 09:12:17AM +0530, Souptick Joarder wrote: > > There is an error when pin_user_pages_fast() returns -ERRNO and > > inside error handling path driver end up calling unpin_user_pages() > >

Re: [RFC PATCH] Add bridge driver to connect sensors to CIO2 device via software nodes on ACPI platforms

2020-09-17 Thread Dan Carpenter
ror in this loop and you want to unwind. With a signed variable you can do: while (--i >= 0) cleanup(&bridge.sensors[i]); There are very few times where raising the type maximum from 2 billion to 4 billion fixes anything. regards, dan carpenter

Re: [RFC PATCH] Add bridge driver to connect sensors to CIO2 device via software nodes on ACPI platforms

2020-09-17 Thread Dan Carpenter
ething along those lines though. Yeah. I suspect you should be using a different callback instead of ->sync_state() but I don't know what... :/ regards, dan carpenter

Re: [RFC PATCH] Add bridge driver to connect sensors to CIO2 device via software nodes on ACPI platforms

2020-09-17 Thread Dan Carpenter
); i++) { a = frob(); if (!a) goto unwind; b = frob(); if (!b) { free(a); goto unwind; } ... } return 0; unwind:

drivers/phy/cadence/phy-cadence-torrent.c:326 cdns_torrent_dp_init() warn: 'cdns_phy->clk' not released on lines: 280.

2020-09-17 Thread Dan Carpenter
.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/phy/cadence/phy-cadence-torrent.c:326 cdns_torrent_dp_init() warn: 'cdns_phy->clk' not rele

Re: [PATCH] mm/gup: protect unpin_user_pages() against npages==-ERRNO

2020-09-17 Thread Dan Carpenter
On Wed, Sep 16, 2020 at 11:57:06PM -0700, John Hubbard wrote: > As suggested by Dan Carpenter, fortify unpin_user_pages() just a bit, > against a typical caller mistake: check if the npages arg is really a > -ERRNO value, which would blow up the unpinning loop: WARN and return. > &

drivers/hwmon/w83627ehf.c:2417 w83627ehf_probe() warn: 'res->start' not released on lines: 2412.

2020-09-17 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 smatch warnings: drivers/hwmon/w83627ehf.c:2417 w83627ehf_probe() warn: 'res->start' not released on lines: 2412. # https://g

Re: [linux-next PATCH] rapidio: Fix error handling path

2020-09-16 Thread Dan Carpenter
On Wed, Sep 16, 2020 at 08:16:09AM -0700, Ira Weiny wrote: > On Wed, Sep 16, 2020 at 01:02:32PM +0300, Dan Carpenter wrote: > > On Wed, Sep 16, 2020 at 09:12:17AM +0530, Souptick Joarder wrote: > > > There is an error when pin_user_pages_fast() returns -ERRNO and > > >

Re: [linux-next PATCH] rapidio: Fix error handling path

2020-09-16 Thread Dan Carpenter
On Wed, Sep 16, 2020 at 01:02:32PM +0300, Dan Carpenter wrote: > On Wed, Sep 16, 2020 at 09:12:17AM +0530, Souptick Joarder wrote: > > There is an error when pin_user_pages_fast() returns -ERRNO and > > inside error handling path driver end up calling unpin_user_pages() > >

Re: [linux-next PATCH] rapidio: Fix error handling path

2020-09-16 Thread Dan Carpenter
ror pointers wouldn't work. So this check can't break anything and it could prevent a crash. regards, dan carpenter

Re: [RESEND PATCH] staging: rtl8188eu: Fix else after return WARNING (checkpatch)

2020-09-15 Thread Dan Carpenter
On Mon, Sep 14, 2020 at 09:42:49AM -0700, Joe Perches wrote: > On Mon, 2020-09-14 at 17:57 +0300, Dan Carpenter wrote: > > On Sun, Sep 13, 2020 at 12:19:50PM +0530, Sohom Datta wrote: > > > > From 4c8c8f3ff7f4d711daea4ac3bb987fcecc7ef1ed Mon Sep 17 00:00:00 2001 > > >

Re: [Linux-kernel-mentees] [PATCH] net: bluetooth: Fix null pointer dereference in hci_event_packet()

2020-09-14 Thread Dan Carpenter
On Sat, Sep 12, 2020 at 02:40:28PM +0530, Anmol Karn wrote: > On Thu, Sep 10, 2020 at 01:49:18PM +0300, Dan Carpenter wrote: > > On Thu, Sep 10, 2020 at 10:04:24AM +0530, Anmol Karn wrote: > > > Prevent hci_phy_link_complete_evt() from dereferencing 'hcon->amp_mgr'

Re: [PATCH v2] i2c: virtio: add a virtio i2c frontend driver

2020-09-14 Thread Dan Carpenter
On Mon, Sep 14, 2020 at 06:24:55PM +0300, Andy Shevchenko wrote: > On Mon, Sep 14, 2020 at 05:48:07PM +0300, Dan Carpenter wrote: > > Hi Jie, > > > > url: > > https://github.com/0day-ci/linux/commits/Jie-Deng/i2c-virtio-add-a-virtio-i2c-frontend-driver/20200911-115

Re: [RESEND PATCH] staging: rtl8188eu: Fix else after return WARNING (checkpatch)

2020-09-14 Thread Dan Carpenter
t;seq_num)) > plist = plist->next; > - else if (SN_EQUAL(pnextattrib->seq_num, pattrib->seq_num)) > - return false; > else > break; > } Checkpatch is just wrong here. Ignore it when it's wrong. regards, dan carpenter

Re: [PATCH v2] i2c: virtio: add a virtio i2c frontend driver

2020-09-14 Thread Dan Carpenter
(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/i2c/busses/i2c-virtio.c:160 virtio_i2c_xfer() error: we previously assumed 'vmsg' could be null (see line 137) # https://

drivers/net/ethernet/mellanox/mlx5/core/en/port.c:453 mlx5e_fec_in_caps() warn: signedness bug returning '(-95)'

2020-09-11 Thread Dan Carpenter
) 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 New smatch warnings: drivers/net/ethernet/mellanox/mlx5/core/en/port.c:453 mlx5e_fec_in_caps() warn: signedness bug returning '

[PATCH] mfd: sm501: Fix leaks in probe()

2020-09-11 Thread Dan Carpenter
This code should clean up if sm501_init_dev() fails. Fixes: b6d6454fdb66 ("[PATCH] mfd: SM501 core driver") Signed-off-by: Dan Carpenter --- drivers/mfd/sm501.c | 8 +++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm5

drivers/net/ethernet/mellanox/mlx5/core/fs_core.c:1555 dest_is_valid() error: we previously assumed 'dest' could be null (see line 1545)

2020-09-11 Thread Dan Carpenter
) 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 New smatch warnings: drivers/net/ethernet/mellanox/mlx5/core/fs_core.c:1555 dest_is_valid() error: we previously assumed '

Re: [Linux-kernel-mentees] [PATCH] net: bluetooth: Fix null pointer dereference in hci_event_packet()

2020-09-10 Thread Dan Carpenter
; + return; > + } > + > if (ev->status) { > hci_conn_del(hcon); > hci_dev_unlock(hdev); regards, dan carpenter

Re: [PATCH] hwmon: (pmbus) Expose PEC debugfs attribute

2020-09-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/hwmon/pmbus/pmbus_core.c:2415 pmbus_debugfs_ops_pec_open() warn: '0x' prefix is confusing together w

Re: [PATCH] staging: media: atomisp: Use kvfree_sensitive in a few places

2020-09-09 Thread Dan Carpenter
ds. Just delete the memset. Looking below, I don't think any of these are sensitive so just delete all the memsets. regards, dan carpenter

[kbuild] Re: [PATCH v2 5/5] media: uvcvideo: Abort uvc_v4l2_open if video device is unregistered

2020-09-09 Thread Dan Carpenter
issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: drivers/media/usb/uvc/uvc_v4l2.c:553 uvc_v4l2_open() warn: possible memory leak of 'handle' # https://github.com/0day-ci/linux/commit/50911975ff9b21d08ff5408e496683

Re: [PATCH printk v4 5/6] printk: ringbuffer: add finalization/extension support

2020-09-09 Thread Dan Carpenter
, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: kernel/printk/printk_ringbuffer.c:1385 prb_reserve_in_last() error: uninitialized symbol 'data_size'. # https://github.com/0day-ci/li

[kbuild] Re: [PATCH] ARC: [plat-eznps]: Drop support for EZChip NPS platform

2020-09-09 Thread Dan Carpenter
Hi Vineet, I love your patch! Yet something to improve: url: https://github.com/0day-ci/linux/commits/Vineet-Gupta/ARC-plat-eznps-Drop-support-for-EZChip-NPS-platform/20200909-121133 base: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git 34d4ddd359dbcdf6c5fb3f85a17924

[kbuild] drivers/irqchip/irq-gic-v3-mbi.c:306 mbi_init() warn: impossible condition '(mbi_phys_base == (-1)) => (0-u32max == u64max)'

2020-09-08 Thread Dan Carpenter
-m031-20200908 (attached as .config) compiler: arm-linux-gnueabi-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/irqchip/irq-gic-v3-mbi.c:306 mbi_init() warn: impossible condition

[PATCH] scsi: libsas: Fix error path in sas_notify_lldd_dev_found()

2020-09-05 Thread Dan Carpenter
ot;) Signed-off-by: Dan Carpenter --- drivers/scsi/libsas/sas_discover.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/scsi/libsas/sas_discover.c b/drivers/scsi/libsas/sas_discover.c index cd7c7d269f6f..d0f9e90e3279 100644 --- a/drivers/scsi/libsas/sas_discover.

[PATCH] blk-mq: Fix refcounting leak in __blk_mq_register_dev()

2020-09-05 Thread Dan Carpenter
"blk-mq: new multi-queue block IO queueing mechanism") Signed-off-by: Dan Carpenter --- block/blk-mq-sysfs.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/block/blk-mq-sysfs.c b/block/blk-mq-sysfs.c index 062229395a50..5a63659163c1 100644 --- a/block/blk-mq-sysf

[PATCH] phy: ti: am654: Fix a leak in serdes_am654_probe()

2020-09-05 Thread Dan Carpenter
If devm_phy_create() fails then we need to call of_clk_del_provider(node) to undo the call to of_clk_add_provider(). Fixes: 71e2f5c5c224 ("phy: ti: Add a new SERDES driver for TI's AM654x SoC") Signed-off-by: Dan Carpenter --- drivers/phy/ti/phy-am654-serdes.c | 6 -- 1

Re: [PATCH v2] staging: media: atomisp: Fix error path in lm3554_probe()

2020-09-03 Thread Dan Carpenter
; anti-pattern where the last condition in the function is different. I just fixed a bug caused by this on Wed. https://www.spinics.net/lists/netdev/msg680226.html But it doesn't cause any problems here so whatever... Reviewed-by: Dan Carpenter regards, dan carpenter

Re: [PATCH] staging: media: atomisp: Fix error path in lm3554_probe()

2020-09-03 Thread Dan Carpenter
. right? You're right. I wonder if there is really any need for the lm3554_gpio_uninit() function at all? It's basically the same as lm3554_gpio_init() except for the order of function calls. Probably we could just rename lm3554_gpio_init() to something like lm3554_gpio_set_default() and use it in both the probe() and remove functions()... But I don't know the code and can't test it so let's leave that for another day. We still do need to clean up if atomisp_register_i2c_module() fails though, and the timer as well so could you resend a v2? regards, dan carpenter

drivers/irqchip/irq-ti-sci-intr.c:148 ti_sci_intr_alloc_parent_irq() warn: impossible condition '(p_hwirq < 0) => (0-u16max < 0)'

2020-09-03 Thread Dan Carpenter
.config) 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/irqchip/irq-ti-sci-intr.c:148 ti_sci_intr_alloc_parent_irq() warn: impossible condition '(p_

Re: [PATCH] staging: media: atomisp: Fix error path in lm3554_probe()

2020-09-03 Thread Dan Carpenter
fail"); > - goto fail2; > + goto err_cleanup_entity; > } > return atomisp_register_i2c_module(&flash->sd, NULL, LED_FLASH); If atomisp_register_i2c_module() fails then we need to call lm3554_gpio_uninit(client) and do other cleanup. > -fail2: > + > +err_cleanup_entity: > media_entity_cleanup(&flash->sd.entity); > +err_free_ctrl_handler: > v4l2_ctrl_handler_free(&flash->ctrl_handler); regards, dan carpenter

Re: [PATCH][next] staging: media: atomisp: fix memory leak of object flash

2020-09-03 Thread Dan Carpenter
4l2_ctrl_handler_free(&flash->ctrl_handler); 908 v4l2_device_unregister_subdev(sd); 909 910 atomisp_gmin_remove_subdev(sd); 911 912 del_timer_sync(&flash->flash_off_delay); 913 914 ret = lm3554_gpio_uninit(client); 915 if (ret < 0) 916 goto fail; 917 918 kfree(flash); 919 920 return 0; 921 fail: 922 dev_err(&client->dev, "gpio request/direction_output fail"); 923 return ret; 924 } regards, dan carpenter

Re: [PATCH] staging: gdm724x: gdm_tty: replaced macro with a function v2

2020-09-02 Thread Dan Carpenter
omments under the --- line > drivers/staging/gdm724x/gdm_tty.c | 15 +-- > 1 file changed, 9 insertions(+), 6 deletions(-) > regards, dan carpenter

Re: [PATCH 4.19 124/125] HID: hiddev: Fix slab-out-of-bounds write in hiddev_ioctl_usage()

2020-09-01 Thread Dan Carpenter
;t think so. I wrote up an explanation earlier just because the code was so confusing. https://lkml.org/lkml/2020/7/20/523 regards, dan carpenter

Re: [PATCH] staging: gdm724x: gdm_tty: corrected macro by adding brackets

2020-09-01 Thread Dan Carpenter
t;port.count) I cannot imagine a real life example where adding these parentheses will prevent a bug. One idea it to silence this by making dereference ops like this a special case where checkpatch.pl doesn't suggest adding parentheses. regards, dan carpenter

Re: Fwd: Re: [PATCH] staging: gdm724x: gdm_tty: corrected macro by adding brackets

2020-09-01 Thread Dan Carpenter
u could just find something else to patch. Probably just find a different bug and fix that instead... If at first you don't succeed, there are tons of other stuff to work on and maybe you will succeed there. ;) regards, dan carpenter

[kbuild] drivers/usb/gadget/udc/fsl_udc_core.c:1055 fsl_ep_fifo_status() error: we previously assumed '_ep->desc' could be null (see line 1055)

2020-09-01 Thread Dan Carpenter
.config) compiler: powerpc-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/gadget/udc/fsl_udc_core.c:1055 fsl_ep_fifo_status() error: we previously assumed '_ep-

Re: [PATCH] staging: atomisp: Fix fallthrough keyword warning

2020-08-31 Thread Dan Carpenter
Really I think this function is pretty buggy. It shouldn't be falling through at all... I reported it a couple days back so it's possible that someone is working on a fix already. regards, dan carpenter

Re: [PATCH] staging: atomisp: Fix fallthrough keyword warning

2020-08-31 Thread Dan Carpenter
Still unreachable, but now it has a checkpatch.pl warning as well. Just get rid of the bogus fallthrough annotation. > case ATOMISP_RUN_MODE_VIDEO: > if (!asd->continuous_mode->val) { regards, dan carpenter

drivers/net/dsa/sja1105/sja1105_main.c:1608 sja1105_static_config_reload() warn: bitwise AND condition is false here

2020-08-31 Thread Dan Carpenter
) compiler: arm-linux-gnueabi-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/dsa/sja1105/sja1105_main.c:1608 sja1105_static_config_reload() warn: bitwise AND condition is false here

drivers/net/dsa/sja1105/sja1105_main.c:2342 sja1105_best_effort_vlan_filtering_set() error: uninitialized symbol 'rc'.

2020-08-31 Thread Dan Carpenter
(attached as .config) compiler: arm-linux-gnueabi-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/dsa/sja1105/sja1105_main.c:2342 sja1105_best_effort_vlan_filtering_set() error

Re: [PATCH 3/3] KVM: nSVM: more strict SMM checks when returning to nested guest

2020-08-31 Thread Dan Carpenter
issue, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter smatch warnings: arch/x86/kvm/svm/svm.c:3915 svm_pre_leave_smm() warn: should this be a bitwise op? # https://github.com/0day-ci/linux/commit/e2317f8eb1f0e9f731ddbe66ab175be19f3bdaf1 git

Re: [PATCH v2 3/3] riscv: Add cache information in AUX vector

2020-08-31 Thread Dan Carpenter
) compiler: riscv64-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: arch/riscv/kernel/cacheinfo.c:55 get_cache_geometry() warn: variable dereferenced before check 'this_leaf'

Re: [PATCH v2] iio: core: Fix IIO_VAL_FRACTIONAL calculation for negative values

2020-08-31 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 smatch warnings: drivers/iio/industrialio-core.c:620 __iio_format_value() error: uninitialized symbol 'tmp'. # https://

[PATCH] afs: Remove erroneous fallthough annotation

2020-08-26 Thread Dan Carpenter
The fall through annotation comes after a return statement so it's not reachable. Signed-off-by: Dan Carpenter --- fs/afs/flock.c | 1 - 1 file changed, 1 deletion(-) diff --git a/fs/afs/flock.c b/fs/afs/flock.c index eff82a6839e4..cb3054c7843e 100644 --- a/fs/afs/flock.c +++ b/fs/afs/fl

[PATCH] selinux: fix error handling bugs in security_load_policy()

2020-08-26 Thread Dan Carpenter
ee the successfully allocated data which avoids the double frees. I also re-ordered selinux_policy_free() so it's in the reverse order of the allocation function. Fixes: c7c556f1e81b ("selinux: refactor changing booleans") Signed-off-by: Dan Carpenter --- I was wrong about context_cpy(). Th

[PATCH] memory: emif: Remove bogus debugfs error handling

2020-08-26 Thread Dan Carpenter
something which wasn't intended to be used in normal situations). Delete all the error handling. Signed-off-by: Dan Carpenter --- drivers/memory/emif.c | 33 + 1 file changed, 5 insertions(+), 28 deletions(-) diff --git a/drivers/memory/emif.c b/drivers/m

[PATCH] dma-pool: Fix an uninitialized variable bug in atomic_pool_expand()

2020-08-26 Thread Dan Carpenter
The "page" pointer can be used with out being initialized. Fixes: d7e673ec2c8e ("dma-pool: Only allocate from CMA when in same memory zone") Signed-off-by: Dan Carpenter --- kernel/dma/pool.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/dma

Re: [PATCH 3/3] iommu/vt-d:Add mutex_unlock() before returning

2020-08-26 Thread Dan Carpenter
On Wed, Aug 26, 2020 at 06:27:52AM -0400, FelixCuioc wrote: > In the probe_acpi_namespace_devices function,when the physical > node of the acpi device is NULL,the unlock function is missing. > Add mutex_unlock(&adev->physical_node_lock). > > Reported-by: Dan Carpenter >

Re: [PATCH 2/3] iommu/vt-d:Add support for probing ACPI device in RMRR

2020-08-26 Thread Dan Carpenter
pr_err("acpi_device probe fail! > ret:%d\n", ret); > + return ret; ^^ This should be goto unlock; > + } > + return 0; > } > + ret = acpi_device_create_direct_mappings(pn_dev, dev); unlock: > mutex_unlock(&adev->physical_node_lock); ^^^ regards, dan carpenter

Re: [PATCH 1/3] iommu/vt-d:Add support for detecting ACPI device in RMRR

2020-08-26 Thread Dan Carpenter
t; + int ret; > + struct dmar_rmrr_unit *rmrru; > + struct acpi_dmar_reserved_memory *rmrr; > + > + list_for_each_entry(rmrru, &dmar_rmrr_units, list) { > + rmrr = container_of(rmrru->hdr, > + struct acpi_dmar_reserved_memory, > + header); > + ret = dmar_acpi_insert_dev_scope(device_number, adev, (void > *)(rmrr + 1), > + ((void *)rmrr) + > rmrr->header.length, > + rmrru->devices, > rmrru->devices_cnt); > + if (ret) > + break; > + } > + return 0; > +} regards, dan carpenter

Re: [PATCH] block: convert tasklets to use new tasklet_setup() API

2020-08-26 Thread Dan Carpenter
- out_cast() or outer_cast() > > > - from_member(). > > > - container_from() or from_container() > > > > > > from_container() sounds fine, would trimming it a bit work? like > > > from_cont(). > > > > I'm fine with container_from(). It's the same form as container_of() > > and I think we need urgent agreement to not stall everything else so > > the most innocuous name is likely to get the widest acceptance. > > Kees, > > Will you be sending the newly proposed API to Linus? I have V2 > which uses container_from() > ready to be sent out. I liked that James swapped the first two arguments so that it matches container_of(). Plus it's nice that when you have: struct whatever *foo = container_from(ptr, foo, member); Then it means that "ptr == &foo->member". regards, dan carpenter

Re: [PATCH] staging: media-atomisp : fix "dubious: !x | !y" sparse warning

2020-08-26 Thread Dan Carpenter
Upon running sparse, "warning: dubious: !x | !y" is brought to notice for this file. Logical and bitwise OR are basically the same in this context so it doesn't cause a runtime bug. But let's change it to logical OR to make it cleaner and silence the Sparse warning. regards,

Re: [PATCH net] mwifiex: Increase AES key storage size to 256 bits

2020-08-25 Thread Dan Carpenter
WLAN_KEY_LEN_CCMP); > +sizeof(key_v2->key_param_set.key_params.aes.key)); > priv->aes_key_v2.key_param_set.key_params.aes.key_len = > cpu_to_le16(len); > memcpy(priv->aes_key_v2.key_param_set.key_params.aes.key, It's good to get the siz

[PATCH] memory: omap-gpmc: Fix a couple off by ones

2020-08-25 Thread Dan Carpenter
These comparisons should be >= instead of > to prevent reading one element beyond the end of the gpmc_cs[] array. Fixes: cdd6928c589a ("ARM: OMAP2+: Add device-tree support for NOR flash") Fixes: f37e4580c409 ("ARM: OMAP2: Dynamic allocator for GPMC memory space") Si

Re: [PATCH v2] workqueue: Warn when work flush own workqueue

2020-08-25 Thread Dan Carpenter
rying to flush the whole @target_wq or @target_work on > > > it. > > > + * If a work flushing own workqueue or itself will lead to a deadlock. > > > > I stumble on understanding challenges for the wording “work flushing”. > > Can an adjustment help in comparison to the term “work item”? > > How about below comment? > > * If a work item flushing own workqueue or itself will lead to a deadlock. Write this: * If a work queue flushes itself, that will lead to a deadlock regards, dan carpenter

Re: [PATCH] staging: emxx_udc: Fix passing of NULL to dma_alloc_coherent()

2020-08-25 Thread Dan Carpenter
On Tue, Aug 25, 2020 at 09:14:59AM +0100, Alex Dewar wrote: > On Tue, Aug 25, 2020 at 10:37:13AM +0300, Dan Carpenter wrote: > > On Mon, Aug 24, 2020 at 04:57:12PM +0100, Alex Dewar wrote: > > > On Mon, Aug 24, 2020 at 04:19:17PM +0100, Alex Dewar wrote: > > > >

Re: [PATCH] staging: emxx_udc: Fix passing of NULL to dma_alloc_coherent()

2020-08-25 Thread Dan Carpenter
> > warning without fixing the breakage. > > > > Can someone cleverer than me tell me if this makes sense? > > > > - Alex > > PS -- I meant to put an RFC in the subject line and an extra tag: > Reported-by: Dan Carpenter > I don't know which dev point

Re: [PATCH v2] HID: roccat: add bounds checking in kone_sysfs_write_settings()

2020-08-25 Thread Dan Carpenter
the style too much. I definitely agree with you, but I figured I would keep the patch less intrusive. regards, dan carpenter

fs/vboxsf/super.c:390 vboxsf_parse_monolithic() warn: impossible condition == (255)) => ((-128)-127 == 255)'

2020-08-24 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: fs/vboxsf/super.c:390 vboxsf_parse_monolithic() warn: impossible condition '(options[1] == (255)) => ((-

Re: [PATCHv2 1/3] ext4: Refactor ext4_overwrite_io() to take ext4_map_blocks as argument

2020-08-24 Thread Dan Carpenter
.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/ext4/file.c:194 ext4_overwrite_io() warn: should '(map->m_lblk + map->m_len) << blkbits' be a 64 bit type? Old smatch

Re: [PATCH v4 2/2] staging: android: Remove BUG from ion_system_heap.c

2020-08-24 Thread Dan Carpenter
On Mon, Aug 24, 2020 at 02:27:08PM +0300, Dan Carpenter wrote: > On Mon, Aug 24, 2020 at 02:24:57PM +0300, Dan Carpenter wrote: > > On Fri, Aug 21, 2020 at 09:25:26AM -0700, Randy Dunlap wrote: > > > On 8/21/20 8:28 AM, Tomer Samara wrote: > > > > Remo

Re: [PATCH v4 2/2] staging: android: Remove BUG from ion_system_heap.c

2020-08-24 Thread Dan Carpenter
On Mon, Aug 24, 2020 at 02:24:57PM +0300, Dan Carpenter wrote: > On Fri, Aug 21, 2020 at 09:25:26AM -0700, Randy Dunlap wrote: > > On 8/21/20 8:28 AM, Tomer Samara wrote: > > > Remove BUG() from ion_sytem_heap.c > > > > > > this fix the following checkpatch is

Re: [PATCH v4 2/2] staging: android: Remove BUG from ion_system_heap.c

2020-08-24 Thread Dan Carpenter
e. > > If some caller calls order_to_index(5), it will return -1, yes? > I was happy enough with the comment as-is given that I suggested it. But an alternative comment could be "/* This is impossible. We always pass valid values to this function. */ regards, dan carpenter

Re: [PATCH v4 1/2] staging: android: Remove BUG_ON from ion_page_pool.c

2020-08-24 Thread Dan Carpenter
; --- You should put a note here about what changed between v3 vs v4. Like so: --- v4: Just remove the BUG_ON()s instead of adding new returns. v3: Hand the new return paths or whatever. Anyway, looks good. Reviewed-by: Dan Carpenter regards, dan carpenter

Re: [PATCH] staging: rtl8192e: fix missing failure check on a call to dev_alloc_name

2020-08-24 Thread Dan Carpenter
ot;Oops: devname failed '%s'!\n", ifname); goto err_unmap; } > > RT_TRACE(COMP_INIT, "Driver probe completed1\n"); regards, dan carpenter

Re: [PATCH] iommu/vt-d:Add support for probing ACPI device in RMRR

2020-08-24 Thread Dan Carpenter
-randconfig-m001-20200820 (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/iommu/intel/iommu.c:4850 probe_acpi_namespace_devices() warn

Re: [PATCH 01/12] staging: wfx: fix BA when device is AP and MFP is enabled

2020-08-24 Thread Dan Carpenter
unt_offset; > + ptr += 1 + pairwise_cipher_suite_size * *ptr; The value of "*ptr" comes from skb->data. How do we know that it doesn't point to something beyond the end of the skb->data buffer? > + ptr += 1 + akm_suite_size * *ptr; > + hif_set_mfp(wvif, *ptr & BIT(7), *ptr & BIT(6)); > + } > +} regards, dan carpenter

Re: [PATCH] staging: greybus: fix warnings detected by sparse

2020-08-24 Thread Dan Carpenter
ret = gb_connection_enable(dai->connection); 451 if (ret) { 452 dev_err(dev, 453 "%d:Error while enabling %d:data connection\n", 454 ret, dai->data_cport); 455 return ret; 456 } 457 } Otherwise it's slightly confusing to mix the values. The rest of the patch seems fine to me. regards, dan carpenter

[PATCH] afs: Fix a use after free in afs_xattr_get_acl()

2020-08-24 Thread Dan Carpenter
The "op" pointer is freed earlier when we call afs_put_operation(). Fixes: e49c7b2f6de7 ("afs: Build an abstraction around an "operation" concept") Signed-off-by: Dan Carpenter --- fs/afs/xattr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/f

[PATCH v2] HID: roccat: add bounds checking in kone_sysfs_write_settings()

2020-08-24 Thread Dan Carpenter
t's safer and easier to verify when the bounds checking is done in the kernel. Fixes: 14bf62cde794 ("HID: add driver for Roccat Kone gaming mouse") Signed-off-by: Dan Carpenter --- v2: In the v1 patch I added a check against settings->size but that's potentially too strict so i

Re: [PATCH v3 2/2] staging: android: Remove BUG from ion_system_heap.c

2020-08-21 Thread Dan Carpenter
tic analysis tools which might complain about this -1 return. But those tools are pretty crap. Never change code just to make the tools happy. regards, dan carpenter

Re: [PATCH v3 1/2] staging: android: Remove BUG_ON from ion_page_pool.c

2020-08-21 Thread Dan Carpenter
hange illustrates how when we start handling impossible conditions then we just have to keep on imagining more and more impossible conditions. When we start trying to write code for situations which we know are impossible that is an unending task. > ion_page_pool_free_pages(pool, page); > freed += (1 << pool->order); > } regards, dan carpenter

Re: [PATCH] scsi: libfc: Fix passing zero to 'PTR_ERR' warning

2020-08-21 Thread Dan Carpenter
ig: x86_64-randconfig-m001-20200818 (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/scsi/libfc/fc_disc.c:371 fc_disc_gpn_ft_req() error: uni

Re: [PATCH] rapidio: fix get device imbalance on error

2020-08-21 Thread Dan Carpenter
_priv: kfree(priv); 3) Create a label to call put_device: err_device: put_device(&chdev->dev); Change all the error paths to use the goto instead of calling put_device() before the goto. regards, dan carpenter

Re: [PATCH v2] staging: greybus: audio: fix uninitialized value issue

2020-08-14 Thread Dan Carpenter
ret, > + __func__, kcontrol->id.name); gb_pm_runtime_put_autosuspend(bundle) on this error path? > + return ret; > + } regards, dan carpenter

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