[tip:irq/core 2/2] kernel/irq/irq_sim.c:246 devm_irq_domain_create_sim() warn: passing zero to 'ERR_PTR'

2021-03-30 Thread Dan Carpenter
) compiler: gcc-9 (Debian 9.3.0-22) 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: kernel/irq/irq_sim.c:246 devm_irq_domain_create_sim() warn: passing zero to 'ERR_PTR' vim +/ERR_PTR +246 kernel/irq

Re: [PATCH][next] mm/vmalloc: Fix read of pointer area after it has been free'd

2021-03-30 Thread Dan Carpenter
r. If the maintainer is going to rebase then they're going to have to think about Fixes tags a bit. Normally rebased trees fold fixes so it's not an issue. Otherwise it would be easy to write a script to correct the Fixes tags during a rebase. In other words, my view is that everyone should just use the same Fixes tag format everywhere. regards, dan carpenter

[kbuild] drivers/gpu/drm/amd/pm/swsmu/amdgpu_smu.c:1370:4: warning: Variable 'num_of_active_display' is modified but its new value is never used. [unreadVariable]

2021-03-29 Thread Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: a5e13c6df0e41702d2b2c77c8ad41677ebb065b3 commit: 75145aab7a0d865b361de687b201e8c4b76425eb drm/amdgpu/swsmu: clean up a bunch of stale interfaces compiler: alpha-linux-gcc (GCC) 9.3.0 If you fix the issue,

Re: [PATCH 2/4] rtc: abx80x: Enable SQW output

2021-03-29 Thread Dan Carpenter
: gcc-9 (Debian 9.3.0-22) 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/rtc/rtc-abx80x.c:561 sqw_set() error: uninitialized symbol 'retval'. vim +/retval +561 drivers/rtc/rtc-abx80x.c

[PATCH 2/2] thunderbolt: Fix off by one in tb_port_find_retimer()

2021-03-29 Thread Dan Carpenter
This array uses 1-based indexing so it corrupts memory one element beyond of the array. Fix it by making the array one element larger. Fixes: dacb12877d92 ("thunderbolt: Add support for on-board retimers") Signed-off-by: Dan Carpenter --- drivers/thunderbolt/retimer.c | 2 +- 1 file

[PATCH 1/2] thunderbolt: Fix a leak in tb_retimer_add()

2021-03-29 Thread Dan Carpenter
imers") Signed-off-by: Dan Carpenter --- This is from a new static checker warning. Not tested. With new warnings it's also possible that I have misunderstood something fundamental so review carefully etc. drivers/thunderbolt/retimer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletio

Re: [PATCH][next] mlxsw: spectrum_router: remove redundant initialization of variable force

2021-03-29 Thread Dan Carpenter
ruct mlxsw_sp > *mlxsw_sp, > { > u16 bucket_index = info->nh_res_bucket->bucket_index; > struct netlink_ext_ack *extack = info->extack; > - bool force = info->nh_res_bucket->force; > + bool force; > char ratr_pl_new[MLXSW_REG_RATR_LEN]; >

Re: [PATCH] bpf: remove redundant assignment of variable id

2021-03-28 Thread Dan Carpenter
ing us to do that but it's never going to happen... :P I do this for networking but it's a massive pain in the butt and I get it wrong 20% of the time. regards, dan carpenter

Re: [PATCH 05/15] staging: rtl8723bs: put parentheses on macros with complex values in include/drv_types.h

2021-03-26 Thread Dan Carpenter
)[13], ((u8 *)(x))[14], ((u8 *)(x))[15]) KEY_ARG() isn't used anywhere that I can see. Just delete it. Please take your time when you re-write this series and think about each change clearly and fix the underlying badness instead of just making checkpatch happy. I would really just throw out the patchset and start over from scratch. regards, dan carpenter

[PATCH] platform/surface: clean up a variable in surface_dtx_read()

2021-03-26 Thread Dan Carpenter
The ">ddev->lock" and ">lock" are the same thing. Let's use ">lock" consistently. Signed-off-by: Dan Carpenter --- drivers/platform/surface/surface_dtx.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/platform/surface

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

2021-03-26 Thread Dan Carpenter
-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/gpu/drm/exynos/exynos_drm_dma.c:144 exynos_drm_register_dma() error: uninitialized symbol 'mapping'. vim +/mapping +144 drivers

[kbuild] fs/btrfs/sysfs.c:1034:4: warning: %u in format string (no. 2) requires 'unsigned int' but the argument type is 'signed int'.

2021-03-26 Thread Dan Carpenter
Hi Kefeng, First bad commit (maybe != root cause): tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 002322402dafd846c424ffa9240a937f49b48c42 commit: ed1ed4c0da5447c5e322481ce2ef9f03336c6ffb riscv: mmiowb: Fix implicit declaration of function

Re: [PATCH 04/15] staging: rtl8723bs: put parentheses on macros with complex values in include/basic_types.h

2021-03-26 Thread Dan Carpenter
LE_BITS_CLEARED_TO_4BYTE(__pstart, __bitoffset, > __bitlen) | \ > + u32)__val) & BIT_LEN_MASK_32(__bitlen)) << > (__bitoffset)) \ > + )\ > ) > These macros are terrible and this makes it uglier. Better to just ignore checkpatch until we can figure out a way to re-write this properly. regards, dan carpenter

Re: [PATCH 02/15] staging: rtl8723bs: put parentheses on macros with complex values in hal/HalBtcOutSrc.h

2021-03-26 Thread Dan Carpenter
> +#define BTC_PRINT_ADDR(dbgtype, dbgflag, printstr, _Ptr) (no_printk printstr) This makes no sense at all. no_printk is a function. The BTC_PRINT() macros are super ugly and this only makes it worse. regards, dan carpenter

Re: [PATCH 01/15] staging: rtl8723bs: inlcude macros in a do..while loop in core/rtw_security.c

2021-03-26 Thread Dan Carpenter
sec->wep_sw_enc_cnt_bc++; \ > + else if (is_multicast_mac_addr(ra)) \ > + sec->wep_sw_enc_cnt_mc++; \ > + else \ > + sec->wep_sw_enc_cnt_uc++; \ > + } while (0) What are these statistics used for? So far as I can see there not used at all. It's probably better to just delete all the DBG_SW_SEC_CNT code. regards, dan carpenter

drivers/dma/ti/k3-udma.c:2635 pktdma_alloc_chan_resources() warn: variable dereferenced before check 'uc->rchan' (see line 2556)

2021-03-26 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 New smatch warnings: drivers/dma/ti/k3-udma.c:2635 pktdma_alloc_chan_resources() warn: variable dereferenced before check 'uc->rc

drivers/dma/ti/k3-udma.c:4236 bcdma_setup_resources() error: 'rm_res' dereferencing possible ERR_PTR()

2021-03-26 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 New smatch warnings: drivers/dma/ti/k3-udma.c:4236 bcdma_setup_resources() error: 'rm_res' dereferencing possible ERR_PTR() Old smatch

Re: [PATCH] staging: greybus: fix fw is NULL but dereferenced

2021-03-25 Thread Dan Carpenter
The commit description is not clear but this patch doesn't change how the code works, it just silences a static checker false positive. Just ignore the false positive. Always just ignore static checkers when they are wrong. regards, dan carpenter

Re: [PATCH] [v3] drivers: staging: _adapter is declared twice

2021-03-25 Thread Dan Carpenter
Bingo! :) Well done. Reviewed-by: Dan Carpenter regards, dan carpenter

Re: [PATCH] drivers: staging: _adapter is declared twice

2021-03-25 Thread Dan Carpenter
> -struct _adapter; > > struct qos_priv{ You need to delete the blank line after it as well to avoid the checkpatch warning about two blank lines in a row. regards, dan carpenter

Re: [PATCH] ALSA: usb-audio: Fix missing return assignment

2021-03-25 Thread Dan Carpenter
On Thu, Mar 25, 2021 at 01:24:23AM +0500, Muhammad Usama Anjum wrote: > On Wed, 2021-03-24 at 21:50 +0300, Dan Carpenter wrote: > > > - usb_driver_claim_interface(driver, iface, (void *)-1L); > > > + err = usb_driver_claim_interface(driver, ifac

Re: [PATCH] ALSA: usb-audio: Fix missing return assignment

2021-03-24 Thread Dan Carpenter
seems sort of weird and pointless that the last value would matter more than the others. > } > > - return 0; > + return err; regards, dan carpenter

Re: [PATCH] drivers:staging: NULL check before some freeing functions is not needed.

2021-03-24 Thread Dan Carpenter
.c:159:4-10: > WARNING: NULL check before some freeing functions is not needed. > Some of these have been fixed already. Please work against linux-next. regards, dan carpenter

Re: [PATCH] drivers:staging: Simplify the if condition

2021-03-24 Thread Dan Carpenter
se work against linux-next. regards, dan carpenter

Re: [PATCH v2 2/2] staging: rtl8192e: Change state information from u16 to u8

2021-03-23 Thread Dan Carpenter
Reviewed-by: Dan Carpenter regards, dan carpenter

Re: [PATCH v2 1/2] staging: rtl8192e: Fix incorrect source in memcpy()

2021-03-23 Thread Dan Carpenter
Reviewed-by: Dan Carpenter This is very clever detective work. How did you spot the bug? regards, dan carpenter

[PATCH] dmaengine: plx_dma: add a missing put_device() on error path

2021-03-23 Thread Dan Carpenter
Add a missing put_device(>dev) if the call to dma_async_device_register(dma); fails. Fixes: 905ca51e63be ("dmaengine: plx-dma: Introduce PLX DMA engine PCI driver skeleton") Signed-off-by: Dan Carpenter --- drivers/dma/plx_dma.c | 18 +++--- 1 file changed, 11 ins

Re: [PATCH 2/5] cifsd: add server-side procedures for SMB3

2021-03-23 Thread Dan Carpenter
> +} > > > > Call this oid_eq()? > Why not compare_oid()? This code is come from cifs. > I need clear reason to change both cifs/cifsd... > Boolean functions should tell you what they are testing in the name. Without any context you can't know what if (compare_oid(one, two)) { means, but if (oid_equal(one, two)) { is readable. regards, dan carpenter

Re: [PATCH 02/11] staging: rtl8723bs: moved function prototypes out of core/rtw_efuse.c

2021-03-22 Thread Dan Carpenter
Can't you just make these functions static instead? regards, dan carpenter

Re: [PATCH] thermal/core: avoid memory leak

2021-03-22 Thread Dan Carpenter
> freeing cdev. > The patch is correct, but Daniel already sent a fix for it. regards, dan carpenter

Re: drivers/staging/qlge/qlge_main.c:4564 qlge_probe() warn: missing error code 'err'

2021-03-22 Thread Dan Carpenter
as soon as you can. Certainly don't wait until "all the TODO items" are done. (0_0) Just do what I do and promise to "fix it tomorrow morning" and then forget about it forever. ;) regards, dan carpenter > On Thu, Feb 25, 2021 at 01:03:03PM +0300, Dan Carpenter wrote: &

Re: [PATCH 3/5] cifsd: add file operations

2021-03-22 Thread Dan Carpenter
d increment this until after the allocation succeeds? > + spin_unlock(_list->wm_lock); > + > + wm = wm_alloc(size, GFP_KERNEL); > + if (!wm) { > + spin_lock(_list->wm_lock); > + wm_list->avail_wm--; > + spin_unlock(_list->wm_lock); > + wait_event(wm_list->wm_wait, > +!list_empty(_list->idle_wm)); > + continue; > + } > + break; > + } > + > + return wm; > +} regards, dan carpenter

Re: [PATCH 2/5] cifsd: add server-side procedures for SMB3

2021-03-22 Thread Dan Carpenter
; > + return 0; > + } else if ((cls != ASN1_UNI) || (con != ASN1_CON) > +|| (tag != ASN1_SEQ)) { > + ksmbd_debug(AUTH, > + "cls = %d con = %d tag = %d end = %p (%d) exit 1\n", > + cls, con, tag, end, *end); > + return 0; > + } > + > + /* sequence */ > + if (asn1_header_decode(, , , , ) == 0) { > + ksmbd_debug(AUTH, "Error decoding 2nd part of negTokenInit\n"); > + return 0; > + } else if ((cls != ASN1_CTX) || (con != ASN1_CON) > +|| (tag != ASN1_EOC)) { > + ksmbd_debug(AUTH, > + "cls = %d con = %d tag = %d end = %p (%d) exit 0\n", > + cls, con, tag, end, *end); > + return 0; > + } > + > + /* sequence of */ > + if (asn1_header_decode > + (, _end, , , ) == 0) { I just ran checkpatch.pl on your patch and I see that you actually fixed all the normal checkpatch.pl warnings. But I'm used to checkpatch.pl --strict code because that's the default in net and staging. This file has 1249 little things like this where checkpatch would have said to write it like: if (!asn1_header_decode(, _end, , , )) { total: 1 errors, 1 warnings, 1249 checks, 24501 lines checked Once a patch has over a thousand style issues then it's too much for me to handle. :P regards, dan carpenter

[PATCH] cifsd: fix error handling in ksmbd_server_init()

2021-03-19 Thread Dan Carpenter
o matches what they expect. In this patch I modified ksmbd_ipc_init() to clean up after itself and then I converted ksmbd_server_init() to use gotos to clean up. Fixes: cabcebc31de4 ("cifsd: introduce SMB3 kernel server") Signed-off-by: Dan Carpenter --- fs/cifsd/server.c| 33 +

[PATCH] stm: class: dummy_stm: fix an error code in dummy_stm_init()

2021-03-19 Thread Dan Carpenter
If the kasprintf() allocation fails after the first iteration through the loop then it returns success instead of -ENOMEM as intended. Fixes: bcfdf8afdebe ("stm class: dummy_stm: Create multiple devices") Signed-off-by: Dan Carpenter --- drivers/hwtracing/stm/dummy_stm.c | 6

Re: [PATCH][next] loop: Fix missing max_active argument in alloc_workqueue call

2021-03-19 Thread Dan Carpenter
t; folding in a fix. Ala Fixes-by: or something like that. I've always lobied for a Fixes-from: tag, but the kbuild-bot tells everyone to add a Reported-by: tag. But then a lot of people are like Reported-by doesn't make sense. And other people are like Reported-by is fine, what's wrong with it? regards, dan carpenter

Re: [PATCH 12/15] staging: rtl8723bs: remove unnecessary logging in os_dep/ioctl_cfg80211.c

2021-03-19 Thread Dan Carpenter
nc__); > #endif The #ifdef can go as well. > > spin_lock_bh(&(pmlmepriv->scanned_queue.lock)); regads, dan carpenter

[PATCH] cifsd: Fix a use after free on error path

2021-03-18 Thread Dan Carpenter
The ksmbd_free_work_struct() frees "work" so we need to swap the order of these two function calls to avoid a use after free. Fixes: cabcebc31de4 ("cifsd: introduce SMB3 kernel server") Signed-off-by: Dan Carpenter --- fs/cifsd/oplock.c | 2 +- 1 file changed, 1 inse

[PATCH RESEND] cifsd: fix a IS_ERR() vs NULL bug

2021-03-18 Thread Dan Carpenter
The smb_direct_alloc_sendmsg() function never returns NULL, it only returns error pointers so the check needs to be updated. Fixes: cabcebc31de4 ("cifsd: introduce SMB3 kernel server") Signed-off-by: Dan Carpenter --- RESEND: Oops. I forgot to CC linux-cifs on this. fs/cifsd/transp

[PATCH] cifsd: fix a precedence bug in parse_dacl()

2021-03-18 Thread Dan Carpenter
The shift has higher precedence than mask so this doesn't work as intended. Fixes: ef24dca82789 ("cifsd: add support for ACLs") Signed-off-by: Dan Carpenter --- fs/cifsd/smbacl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/cifsd/smbacl.c b/fs/cifsd/smba

[PATCH] cifsd: fix a IS_ERR() vs NULL bug

2021-03-18 Thread Dan Carpenter
The smb_direct_alloc_sendmsg() function never returns NULL, it only returns error pointers so the check needs to be updated. Fixes: cabcebc31de4 ("cifsd: introduce SMB3 kernel server") Signed-off-by: Dan Carpenter --- fs/cifsd/transport_rdma.c | 4 ++-- 1 file changed, 2 insert

[PATCH] HID: ft260: fix an error message in ft260_i2c_write_read()

2021-03-18 Thread Dan Carpenter
The "len" variable is uninitialize. Fixes: 6a82582d9fa4 ("HID: ft260: add usb hid to i2c host bridge driver") Signed-off-by: Dan Carpenter --- drivers/hid/hid-ft260.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/hid/hid-ft260.c b/drivers/h

Re: [PATCH] drivers: staging: qlge: Fixed an alignment issue.

2021-03-17 Thread Dan Carpenter
int qlge_adapter_down(struct qlge_adapter *qdev) > qlge_tx_ring_clean(qdev); > > /* Call netif_napi_del() from common point. > - */ > + */ This has already been fixed upstream. You should be working against linux-next or staging-next. https://lore.kernel.org/driverdev-devel/

Re: [PATCH] staging: comedi: das800: fix request_irq() warn

2021-03-17 Thread Dan Carpenter
ommon enough to worry about. regards, dan carpenter

Re: [PATCH] staging: comedi: das800: fix request_irq() warn

2021-03-16 Thread Dan Carpenter
e copy and pasting "repalce" over and over... > and the entry in /proc/irq/ will not be created > since the .name might be used by userspace and we don't want to break > userspace, so we are changing the parameters passed to request_irq() regards, dan carpenter

Re: [PATCH v2 1/5] hwmon: (max31790) Rework to use regmap

2021-03-16 Thread Dan Carpenter
piler: gcc-9 (Debian 9.3.0-22) 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/max31790.c:263 max31790_fan_is_visible() warn: impossible condition '(fan_config < 0) => (0-255 < 0)'

[PATCH] lib/test_hmm.c: fix harmless shift wrapping bug

2021-03-16 Thread Dan Carpenter
d. Fixes: b2ef9f5a5cb3 ("mm/hmm/test: add selftest driver for HMM") Signed-off-by: Dan Carpenter --- lib/test_hmm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/test_hmm.c b/lib/test_hmm.c index 80a78877bd93..541466034a6b 100644 --- a/lib/test_hmm.c +++ b/lib/test_hmm.c @@ -930

drivers/usb/host/ohci-hcd.c:1318 ohci_hcd_mod_init() warn: ignoring unreachable code.

2021-03-16 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 smatch warnings: drivers/usb/host/ohci-hcd.c:1318 ohci_hcd_mod_init() warn: ignoring unreachable code. vim +1318 drivers/usb/host/ohci

Re: [PATCH v2] staging: rtl8192u: remove extra lines

2021-03-16 Thread Dan Carpenter
^^^ The commit message says you're removing lines but you're also adding them. :P regards, dan carpenter

Re: [PATCH] prctl: fix PR_SET_MM_AUXV kernel stack leak

2021-03-15 Thread Dan Carpenter
xv)); 2095 2096 task_lock(current); 2097 memcpy(mm->saved_auxv, user_auxv, len); ^^ Saves one byte to mm->saved_auxv. 2098 task_unlock(current); 2099 2100 return 0; 2101 } regards, dan carpenter

Re: [PATCH] staging: rtl8723bs: add initial value

2021-03-12 Thread Dan Carpenter
line so all the patch does is introduce static checker warnings for no reason. regards, dan carpenter

[PATCH] regulator: bd9576: Fix return from bd957x_probe()

2021-03-11 Thread Dan Carpenter
The probe() function returns an uninitialized variable in the success path. There is no need for the "err" variable at all, just delete it. Fixes: b014e9fae7e7 ("regulator: Support ROHM BD9576MUF and BD9573MUF") Signed-off-by: Dan Carpenter --- drivers/regulator/bd9

Re: [PATCH] staging: rtl8723bs: align comments

2021-03-10 Thread Dan Carpenter
0/40 MHz BSS or > + *- all STAs in the BSS are 20 MHz HT in 20 MHz BSS > + *Set to 1 (HT non-member protection) if there may be non-HT STAs > + *in both the primary and the secondary channel > + *Set to 2 if only HT STAs are associated in BSS, > + *however and at least one 20 MHz

[kbuild] Re: [PATCH 3/3] pinctrl: Ingenic: Add support for new Ingenic SoCs.

2021-03-10 Thread Dan Carpenter
onfig) compiler: microblaze-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/pinctrl/pinctrl-ingenic.c:2829 irq_set_type() error: uninitialized symbol 'val3'. vim +/val3 +2829 dr

[PATCH] w1: w1_therm: use clamp() in int_to_short()

2021-03-09 Thread Dan Carpenter
It's slightly cleaner to use the clamp() macro instead of open coding this. Signed-off-by: Dan Carpenter --- drivers/w1/slaves/w1_therm.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/w1/slaves/w1_therm.c b/drivers/w1/slaves/w1_therm.c index 976eea28f268

[kbuild] Re: [PATCH v3 1/2] char: xillybus: Move class-related functions to new xillybus_class.c

2021-03-09 Thread Dan Carpenter
as .config) compiler: gcc-9 (Debian 9.3.0-22) 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/char/xillybus/xillybus_class.c:86 xillybus_init_chrdev() warn: ignoring unreachable code. drivers/char

Re: Re: [PATCH] Input: elan_i2c - Reduce the resume time for new dev ices

2021-03-08 Thread Dan Carpenter
) compiler: gcc-9 (Debian 9.3.0-22) 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/mouse/elan_i2c_core.c:122 elan_i2c_lookup_quirks() warn: ignoring unreachable code. vim +122 drivers

Re: [PATCH] staging: rtl8192e: Fix possible buffer overflow in _rtl92e_wx_set_scan

2021-03-07 Thread Dan Carpenter
that it's 0-255. I had not marked "msg1.ssid.data.data" as a protected struct member so it didn't generate a warning. I think cfg80211_scan_request structs are filled out in a systematic way in ieee80211_request_ibss_scan() and they're bounds checked properly so this isn't a bug. >

Re: [PATCH] staging: rtl8192e: Fix possible buffer overflow in _rtl92e_wx_set_scan

2021-03-05 Thread Dan Carpenter
has problems. I really want Smatch to be able to figure the netlink stuff... That should be doable. regards, dan carpenter

Re: [PATCH] crypto: qat - fix use of 'dma_map_single'

2021-03-04 Thread Dan Carpenter
9.3.0-22) 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/qat/qat_common/qat_algs.c:809 qat_alg_sgl_to_bufl() error: uninitialized symbol 'blp'. vim +/blp +809 drivers/crypto/qat

Re: drivers/mtd/parsers/qcomsmempart.c:109 parse_qcomsmem_part() warn: passing zero to 'PTR_ERR'

2021-03-03 Thread Dan Carpenter
he commit signers. I tested your patch and it added for me. regards, dan carpenter

[PATCH RESEND] rsxx: Return -EFAULT if copy_to_user() fails

2021-03-03 Thread Dan Carpenter
ding in debugfs entries.") Signed-off-by: Dan Carpenter --- I sent this last June as part of a 2 patch series. No one responded to the patches. The first patch was a NULL derefence fix but I now think that the correct fix for that is to remove the "enable_blkdev" module

drivers/mtd/parsers/qcomsmempart.c:109 parse_qcomsmem_part() warn: passing zero to 'PTR_ERR'

2021-03-03 Thread Dan Carpenter
-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/mtd/parsers/qcomsmempart.c:109 parse_qcomsmem_part() warn: passing zero to 'PTR_ERR' vim +/PTR_ERR +109 drivers/mtd/parsers

drivers/soc/mediatek/mtk-pm-domains.c:492 scpsys_add_subdomain() warn: missing error code 'ret'

2021-03-03 Thread Dan Carpenter
(attached as .config) compiler: nds32le-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/soc/mediatek/mtk-pm-domains.c:492 scpsys_add_subdomain() warn: missing error code 'ret

Re: [PATCH] firewire: prevent integer overflow on 32bit systems

2021-03-03 Thread Dan Carpenter
On Tue, Mar 02, 2021 at 10:19:11PM +0100, Stefan Richter wrote: > On Mar 02 Dan Carpenter wrote: > > In TCODE_STREAM_DATA mode, on 32bit systems, the "sizeof(*e) + > > request->length" operation can overflow leading to memory corruption. > > > > Fixes: 18

Re: drivers/pinctrl/qcom/pinctrl-lpass-lpi.c:458 lpi_config_set() error: uninitialized symbol 'strength'.

2021-03-02 Thread Dan Carpenter
On Tue, Mar 02, 2021 at 07:28:05PM +0300, Dan Carpenter wrote: > On Tue, Mar 02, 2021 at 04:47:01PM +0100, Linus Walleij wrote: > > On Sat, Feb 27, 2021 at 10:22 AM Dan Carpenter > > wrote: > > > > > New smatch warnings: > > > drivers/pinctrl/qcom/pinctrl

Re: drivers/pinctrl/qcom/pinctrl-lpass-lpi.c:458 lpi_config_set() error: uninitialized symbol 'strength'.

2021-03-02 Thread Dan Carpenter
On Tue, Mar 02, 2021 at 04:47:01PM +0100, Linus Walleij wrote: > On Sat, Feb 27, 2021 at 10:22 AM Dan Carpenter > wrote: > > > New smatch warnings: > > drivers/pinctrl/qcom/pinctrl-lpass-lpi.c:458 lpi_config_set() error: > > uninitialized symbol 'strength'.

Re: [PATCH] staging: rtl8192e: remove unnecessary break

2021-03-02 Thread Dan Carpenter
ry. The patch introduces a bug. You need to be careful following checkpatch's advice because it's just a simple Perl script. > } regards, dan carpenter

Re: drivers/pinctrl/qcom/pinctrl-lpass-lpi.c:458 lpi_config_set() error: uninitialized symbol 'strength'.

2021-03-02 Thread Dan Carpenter
On Tue, Mar 02, 2021 at 04:47:01PM +0100, Linus Walleij wrote: > On Sat, Feb 27, 2021 at 10:22 AM Dan Carpenter > wrote: > > > New smatch warnings: > > drivers/pinctrl/qcom/pinctrl-lpass-lpi.c:458 lpi_config_set() error: > > uninitialized symbol 'strength'.

[kbuild] drivers/spi/spi-cadence-quadspi.c:250:18: warning: Shifting signed 32-bit value by 31 bits is undefined behaviour

2021-03-02 Thread Dan Carpenter
, kindly add following tag as appropriate Reported-by: kernel test robot Reported-by: Dan Carpenter cppcheck possible warnings: (new ones prefixed by >>, may not real problems) >> drivers/spi/spi-cadence-quadspi.c:250:18: warning: Shifting signed 32-bit >> value by 31 bits is u

[PATCH] firewire: prevent integer overflow on 32bit systems

2021-03-02 Thread Dan Carpenter
In TCODE_STREAM_DATA mode, on 32bit systems, the "sizeof(*e) + request->length" operation can overflow leading to memory corruption. Fixes: 18e9b10fcdc0 ("firewire: cdev: add closure to async stream ioctl") Signed-off-by: Dan Carpenter --- drivers/firewire/core-cdev.c | 3

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

2021-03-02 Thread Dan Carpenter
: xtensa-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/gpu/drm/exynos/exynos_drm_dma.c:144 exynos_drm_register_dma() error: uninitialized symbol 'mapping'. vim +/mapping +144

Re: [PATCH] staging: rtl8192e: Fix possible buffer overflow in _rtl92e_wx_set_scan

2021-03-01 Thread Dan Carpenter
On Fri, Feb 26, 2021 at 05:05:26PM +0300, Dan Carpenter wrote: > Here is a v2 of my check. I've changed it to mark all "->ssid" and > everything in "(struct ieee80211_network)" as protected. I'm just > playing around with it at this point to explore what works

drivers/gpu/drm/msm/msm_gem_submit.c:202 submit_lookup_cmds() warn: impossible condition '(sz == (~0)) => (0-u32max == u64max)'

2021-03-01 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/gpu/drm/msm/msm_gem_submit.c:202 submit_lookup_cmds() warn: impossible condition '(sz == (~0)) => (0-u32

drivers/gpu/drm/msm/dp/dp_debug.c:218 dp_debug_init() warn: passing zero to 'PTR_ERR'

2021-02-28 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/gpu/drm/msm/dp/dp_debug.c:218 dp_debug_init() warn: passing zero to 'PTR_ERR' Old smatch warnings: drivers/gpu/drm

drivers/gpu/drm/msm/disp/dpu1/dpu_rm.c:106 dpu_rm_init() warn: passing zero to 'PTR_ERR'

2021-02-28 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/gpu/drm/msm/disp/dpu1/dpu_rm.c:106 dpu_rm_init() warn: passing zero to 'PTR_ERR' Old smatch warnings: drivers/gpu/drm/msm

drivers/gpu/drm/msm/dp/dp_hpd.c:37 dp_hpd_connect() error: we previously assumed 'hpd_priv->dp_cb' could be null (see line 37)

2021-02-28 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 smatch warnings: drivers/gpu/drm/msm/dp/dp_hpd.c:37 dp_hpd_connect() error: we previously assumed 'hpd_priv->dp_cb' could be null (see line

drivers/gpu/drm/msm/disp/dpu1/dpu_hw_dspp.c:31 dpu_setup_dspp_pcc() warn: variable dereferenced before check 'ctx' (see line 29)

2021-02-28 Thread Dan Carpenter
as .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/gpu/drm/msm/disp/dpu1/dpu_hw_dspp.c:31 dpu_setup_dspp_pcc() warn: variable dereferenced before check 'ctx

Re: [PATCH] staging: rtl8192u avoid flex array of flex array

2021-02-28 Thread Dan Carpenter
; > u8 len; > - u8 data[]; > + u8 data[0]; Nah... Just ignore Sparse on this. regards, dan carpenter

Re: [PATCH] staging: rtl8723bs: Fixed indentation and coding style

2021-02-28 Thread Dan Carpenter
This indenting style is wrong. There should be a spaces around the '*' character: /* * Result: * 0x00: success * 0x01: sucess, and check Response. * 0x02: cmd ignored due to duplicated sequcne number * 0x03: cmd dropped due to invalid cmd code * 0x04: reserved. */ regards, dan carpenter

arch/powerpc/sysdev/xive/common.c:1614 xive_debug_show_irq() warn: variable dereferenced before check 'd' (see line 1596)

2021-02-27 Thread Dan Carpenter
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 New smatch warnings: arch/powerpc/sysdev/xive/common.c:1614 xive_debug_show_irq() warn: variable dereferenced before check

Re: [PATCH] media: i2c: adp1653: fix error handling from a call to adp1653_get_fault

2021-02-27 Thread Dan Carpenter
lash->fault & ADP1653_REG_FAULT_FLT_OV) 159 ctrl->cur.val |= V4L2_FLASH_FAULT_OVER_VOLTAGE; 160 161 flash->fault = 0; 162 163 return 0; 164 } regards, dan carpenter

arch/powerpc/sysdev/xive/common.c:279 xmon_xive_get_irq_config() warn: variable dereferenced before check 'd' (see line 261)

2021-02-27 Thread Dan Carpenter
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: arch/powerpc/sysdev/xive/common.c:279 xmon_xive_get_irq_config() warn: variable dereferenced before check 'd

drivers/cpufreq/qcom-cpufreq-hw.c:377 qcom_cpufreq_hw_cpu_init() error: we previously assumed 'data' could be null (see line 327)

2021-02-27 Thread Dan Carpenter
as .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/cpufreq/qcom-cpufreq-hw.c:377 qcom_cpufreq_hw_cpu_init() error: we previously assumed 'data' could

drivers/pinctrl/qcom/pinctrl-lpass-lpi.c:458 lpi_config_set() error: uninitialized symbol 'strength'.

2021-02-27 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 New smatch warnings: drivers/pinctrl/qcom/pinctrl-lpass-lpi.c:458 lpi_config_set() error: uninitialized symbol 'strength'. Old smatch

Re: [PATCH v3] staging: rtl8192e: Fix possible buffer overflow in _rtl92e_wx_set_scan

2021-02-26 Thread Dan Carpenter
On Fri, Feb 26, 2021 at 02:51:57PM +, Lee Gibson wrote: > Function _rtl92e_wx_set_scan calls memcpy without checking the length. > A user could control that length and trigger a buffer overflow. > Fix by checking the length is within the maximum allowed size. > > Reviewed-by

Re: [PATCH] staging: rtl8192e: Fix possible buffer overflow in _rtl92e_wx_set_scan

2021-02-26 Thread Dan Carpenter
Here is a v2 of my check. I've changed it to mark all "->ssid" and everything in "(struct ieee80211_network)" as protected. I'm just playing around with it at this point to explore what works best. It's impossible to know until after some results come back. regards,

Re: [PATCH v2] staging: rtl8192e: Fix possible buffer overflow in _rtl92e_wx_set_scan

2021-02-26 Thread Dan Carpenter
; Changes in v2: > Changed to use min_t as per useful suggestions This kind of information is supposed to go below the --- cut off line > > Signed-off-by: Lee Gibson > --- ^^^ here. regards, dan carpenter

Re: [PATCH] staging: rtl8192e: Fix possible buffer overflow in _rtl92e_wx_set_scan

2021-02-26 Thread Dan Carpenter
req->essid, > req->essid_len); > -- Well done. You can add a Reviewed-by: Dan Carpenter to your final patch. How did you spot this bug? It's so ancient that the Fixes tag would look messed up. commit 94a799425eee8225a1e3fbe5f473d2ef04002577 Author: Larry F

Re: [PATCH] staging: rtl8192e: Fix possible buffer overflow in _rtl92e_wx_set_scan

2021-02-26 Thread Dan Carpenter
_SIZE; > > + > > How about using the "pattern" the other wireless drivers use of: > > int len = min((int)req->essid_len, IW_ESSID_MAX_SIZE); I bet checkpatch complains that we should use min_t() instead (but I'm too lazy to verify). int len = min_t(int, req->essid_len, IW_ESSID_MAX_SIZE); regards, dan carpenter

[kbuild] drivers/scsi/ufs/ufs-mediatek.c:530:17: sparse: sparse: dubious: x & !y

2021-02-25 Thread Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 29c395c77a9a514c5857c45ceae2665e9bd99ac7 commit: 488edafb1120f715bebd80b6fe4089f83fb082b2 scsi: ufs-mediatek: Introduce low-power mode for device power supply config: arm64-randconfig-s031-20210225

drivers/staging/qlge/qlge_main.c:4564 qlge_probe() warn: missing error code 'err'

2021-02-25 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/staging/qlge/qlge_main.c:4564 qlge_probe() warn: missing error code 'err' vim +/err +4564 drivers/staging

Re: [PATCH v2 00/13] bss_ht struct cleanups

2021-02-24 Thread Dan Carpenter
Looks good. Reviewed-by: Dan Carpenter regards, dan carpenter

drivers/net/wan/lmc/lmc_main.c:947 lmc_init_one() warn: 'dev' not released on lines: 903.

2021-02-24 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/wan/lmc/lmc_main.c:947 lmc_init_one() warn: 'dev' not released on lines: 903. Old smatch

Re: [PATCH 0/2] fix sparse warnings

2021-02-24 Thread Dan Carpenter
t; > > > drivers/staging/wimax/i2400m/fw.c| 2 +- > > drivers/staging/wimax/i2400m/op-rfkill.c | 2 +- > > 2 files changed, 2 insertions(+), 2 deletions(-) > > > > -- > > 2.30.1 > > > ping? The merge window is open so no one is merging these types of fixes now. Wait until -rc1 is out, and then give the maintainer two weeks to look at your patch and get back to you. regards, dan carpenter

Re: [PATCH] memory: gpmc: fix out of bounds read and dereference on gpmc_cs[]

2021-02-23 Thread Dan Carpenter
009,8 +1009,8 @@ EXPORT_SYMBOL(gpmc_cs_request); > > void gpmc_cs_free(int cs) > { > - struct gpmc_cs_data *gpmc = _cs[cs]; > - struct resource *res = >mem; There is no actual dereferencing going on here, it just taking the addresses. But the patch is also harmless and improves readability. regards, dan carpenter

Re: [PATCH 01/13] staging: rtl8192e: remove blank line in bss_ht struct

2021-02-23 Thread Dan Carpenter
arning about a blank line after an open curly brace. Rename FooBar to foo_bar to silence a checkpatch warning about CamelCase. regards, dan carpenter

Re: [PATCH v3 4/4] PCI: j721e: Add support to provide refclk to PCIe connector

2021-02-22 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/pci/controller/cadence/pci-j721e.c:420 j721e_pcie_probe() warn: missing error code 'ret' vim +/ret +420 drivers/pci/controller

Re: [PATCH] staging: wlan-ng/p80211 : check userspacebuf size for sanity

2021-02-22 Thread Dan Carpenter
I have added the Driver Devel list to the CC list. Adding linux-kernel is sort of useless. The correct people who are interested in this patch are all on the Driver Devel list. On Mon, Feb 22, 2021 at 07:12:22PM +0530, karthek wrote: > On Mon, Feb 22, 2021 at 04:21:33PM +0300, Dan Carpen

Re: [PATCH] staging: wimax: fix sparse incorrect type issue

2021-02-22 Thread Dan Carpenter
On Mon, Feb 22, 2021 at 11:31:48AM +0530, karthek wrote: > On Mon, Feb 22, 2021 at 11:10 AM Dan Carpenter > wrote: > > > > On Sat, Feb 20, 2021 at 05:04:00PM +0530, karthik alapati wrote: > > > fix sparse warning by casting to explicit user address-space > > >

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