Re: KASAN: slab-out-of-bounds Read in add_adv_patterns_monitor

2021-02-01 Thread Dan Carpenter
u > > BT_DBG("request for %s", hdev->name); > > - if (len <= sizeof(*cp) || cp->pattern_count == 0) { > + if (len <= sizeof(*cp) || cp->pattern_count == 0 || > + len < sizeof(*cp) + cp->pattern_count * > + sizeof(struct mgmt_adv_pattern)) { > err = mgmt_cmd_status(sk, hdev->id, > MGMT_OP_ADD_ADV_PATTERNS_MONITOR, > MGMT_STATUS_INVALID_PARAMS); > I think this was already fixed on Jan 22 commit b4a221ea8a1f ("Bluetooth: advmon offload MSFT add rssi support"). expected_size += cp->pattern_count * sizeof(struct mgmt_adv_pattern); if (len != expected_size) { Now someone needs to backport it to stable. regards, dan carpenter

Re: [PATCH v3 06/11] iio: core: merge buffer/ & scan_elements/ attributes

2021-02-01 Thread Dan Carpenter
as .config) compiler: arc-elf-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/iio/industrialio-buffer.c:1413 __iio_buffer_alloc_sysfs_and_mask() error: uninitialized symbol 'ret'. vim

[PATCH] ceph: Fix an Oops in error handling

2021-02-01 Thread Dan Carpenter
The "req" pointer is an error pointer and not NULL so this check needs to be fixed. Fixes: 1cf7fdf52d5a ("ceph: convert readpage to fscache read helper") Signed-off-by: Dan Carpenter --- fs/ceph/addr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/c

[PATCH] bus: fsl-mc: Fix test for end of loop

2021-02-01 Thread Dan Carpenter
d fsl-mc userspace support") Signed-off-by: Dan Carpenter --- drivers/bus/fsl-mc/fsl-mc-uapi.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/bus/fsl-mc/fsl-mc-uapi.c b/drivers/bus/fsl-mc/fsl-mc-uapi.c index eeb988c9f4bb..bdcd9d983a78 100644 --- a/drivers/bus/fsl-m

[PATCH] ocfs2: Fix a use after free on error

2021-02-01 Thread Dan Carpenter
The error handling in this function frees "reg" but it is still on the "o2hb_all_regions" list so it will lead to a use after free. The fix for this is to only add it to the list after everything has succeeded. Fixes: 1cf257f51191 ("ocfs2: fix memory leak"

[PATCH] misc: bcm-vk: unlock on error in bcm_to_h_msg_dequeue()

2021-02-01 Thread Dan Carpenter
Unlock before returning on this error path. Fixes: 111d746bb476 ("misc: bcm-vk: add VK messaging support") Signed-off-by: Dan Carpenter --- drivers/misc/bcm-vk/bcm_vk_msg.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/misc/bcm-vk/bcm_vk_msg.c b/driver

[kbuild] drivers/accessibility/speakup/speakup_audptr.c:138:20: warning: Array index 'test' is used before limits check.

2021-01-28 Thread Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 76c057c84d286140c6c416c3b4ba832cd1d8984e commit: 2067fd92d75b6d9085a43caf050bca5d88c491b8 staging/speakup: Move out of staging compiler: ia64-linux-gcc (GCC) 9.3.0 If you fix the issue, kindly add

Re: [PATCH][next] nfsd: fix check of statid returned from call to find_stateid_by_type

2021-01-28 Thread Dan Carpenter
ainers. 2) Metrics to figure out how quickly we are fixing bugs. 3) Sometimes the Fixes tag helps because we want to review the original patch to see what the intent was. All sorts of stuff. Etc. regards, dan carpenter

Re: [PATCH v12] staging: fbtft: add tearing signal detect

2021-01-28 Thread Dan Carpenter
Ditto for > PTR_ERR(). Have you even looked for these macros implementations? > Yeah... It leads to a compile warning: warning: passing argument 1 of ‘IS_ERR’ makes pointer from integer without a cast [-Wint-conversion] regards, dan carpenter

Re: [PATCH v10] staging: fbtft: add tearing signal detect

2021-01-28 Thread Dan Carpenter
er should fix the error or disable the feature if they want to continue. There are lots of places in the kernel where the error handling could be written to try continue but in a crippled state. It's not the right approach. Over engineering like that just leads to bugs. regards, dan carpenter

smatch v1.71 released

2021-01-28 Thread Dan Carpenter
/test_kernel.sh This is kind of a weird release because it's been so long since the previous release. I'm hoping to do more regular releases with better release notes. Releases are good because hopefully more people will do a fresh pull and send me bug reports. :) regards, dan carpenter

[PATCH] mtd: parser_imagetag: fix error codes in bcm963xx_parse_imagetag_partitions()

2021-01-28 Thread Dan Carpenter
If the kstrtouint() calls fail, then this should return a negative error code but it currently returns success. Fixes: dd84cb022b31 ("mtd: bcm63xxpart: move imagetag parsing to its own parser") Signed-off-by: Dan Carpenter --- drivers/mtd/parsers/parser_imagetag.c | 4 1 file

Re: [PATCH v10] staging: fbtft: add tearing signal detect

2021-01-27 Thread Dan Carpenter
ere that is missing the fact that > a line is being indented with spaces and not tabs in the patch > at > https://lore.kernel.org/r/1611754972-151016-1-git-send-email-zhangxuez...@gmail.com > > Any ideas what broke? > /*Tearing Effect Line On*/ Comments are the exception to the "no spaces at the start of a line" rule. I was expecting that the kbuild-bot would send a Smatch warning for inconsistent indenting, but comments are not counted there either. I'm sort of surprised that we don't have checkpatch rule about the missing space characters. It should be: "/* Tearing Effect Line On */". regards, dan carpenter

Re: [PATCH v6] fbtft: add tearing signal detect

2021-01-27 Thread Dan Carpenter
gpiod_to_irq(par->gpio.te)); > + pr_info("TE request_irq completion.\n"); #SadFaceEmoji > + } > + } else { > + pr_info("%s:%d, TE gpio not specified\n", > + __func__, __LINE__); > + } regards, dan carpenter

Re: [PATCH v5] fbtft: add tearing signal detect

2021-01-26 Thread Dan Carpenter
("Failed to request te gpio: %d\n", rc); > par->gpio.te = NULL; > } I wish you would just copy and paste the code that I sent you instead, but this also fixes the crash... regards, dan carpenter

Re: [PATCH v5] fbtft: add tearing signal detect

2021-01-26 Thread Dan Carpenter
on the success path. You should add that to your code while your debugging the feature, but don't push it to the upstream kernel. > + } > + } else { > + pr_info("%s:%d, TE gpio not specified\n", > + __func__, __LINE__); > + } regards, dan carpenter

Re: [PATCH v5] fbtft: add tearing signal detect

2021-01-26 Thread Dan Carpenter
the error code. Write it exactly like this: par->gpio.te = devm_gpiod_get_index_optional(dev, "te", 0, GPIOD_IN); if (IS_ERR(par->gpio.te)) return PTR_ERR(par->gpio.te); if (par->gpio.te) { init_completion(_panel_te); regards, dan carpenter

Re: [PATCH v4] fbtft: add tearing signal detect

2021-01-26 Thread Dan Carpenter
par->gpio.te = NULL; > + } else { > + disable_irq_nosync(gpiod_to_irq(par->gpio.te)); > + pr_info("TE request_irq completion.\n"); > + } > + } else { > + pr_err("%s:%d, TE gpio not specified\n", > +__func__, __LINE__); > + } regards, dan carpenter

[PATCH] scsi: qla2xxx: fix some memory corruption

2021-01-26 Thread Dan Carpenter
This was supposed to be "data" instead of "". The current code will corrupt the stack. Fixes: dbf1f53cfd23 ("scsi: qla2xxx: Implementation to get and manage host, target stats and initiator port") Signed-off-by: Dan Carpenter --- drivers/scsi/qla2xxx/qla_b

Re: [PATCH v2] fbtft: add tearing signal detect

2021-01-26 Thread Dan Carpenter
On Mon, Jan 25, 2021 at 04:44:12PM +0800, Carlis wrote: > From: "carlis.zhang_cp" I was really expecting that you would fix this and Signed-off-by as well. regards, dan carpenter

Re: [PATCH] fbtft: add tearing signal detect

2021-01-26 Thread Dan Carpenter
e); > + rc = wait_for_completion_timeout(_panel_te, > + > msecs_to_jiffies(SPI_PANEL_TE_TIMEOUT)); > + if (rc == 0) > + pr_err("wait panel TE time out\n"); > + } > + ret = par->fbtftops.write(par, par->txbuf.buf, > + startbyte_size > + to_copy * 2); Line break is whacky. > + if (par->gpio.te) > + enable_spi_panel_te_irq(par, false); > + if (ret < 0) > + return ret; > + remain -= to_copy; > + } > + > + return ret; Shouldn't this be "return len;" or something? > +} > + regards, dan carpenter

[kbuild] Re: [PATCH v2 11/12][RESEND] iio: buffer: introduce support for attaching more IIO buffers

2021-01-25 Thread Dan Carpenter
config: i386-randconfig-m021-20210125 (attached as .config) compiler: gcc-9 (Debian 9.3.0-20) 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-buffer.c:1606

[PATCH] drm/i915/gvt: fix uninitialized return in intel_gvt_update_reg_whitelist()

2021-01-25 Thread Dan Carpenter
/gvt: parse init context to update cmd accessible reg whitelist") Signed-off-by: Dan Carpenter --- drivers/gpu/drm/i915/gvt/cmd_parser.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/gvt/cmd_parser.c b/drivers/gpu/drm/i915/gvt/cmd_parser.c index 7fb9

Re: [PATCH] MAINTAINERS: adjust to clang-version.sh removal

2021-01-23 Thread Dan Carpenter
In networking then they want you to say which tree it applies to, but it's not as simple as saying "net" vs "net-next". If it's a bugfix then you should write that against "net" but if it's a clean up or a fix to a recent change then it should be written against "net-next". Also linux-next is

Re: [PATCH] MAINTAINERS: adjust to clang-version.sh removal

2021-01-22 Thread Dan Carpenter
t say "doesn't apply. resend if needed". We may as well just say [PATCH linux-next]. No one is ever going to look up the date if it doesn't apply to the latest linux-next. regards, dan carpenter

[PATCH v2] media: zr364xx: fix memory leaks in probe()

2021-01-20 Thread Dan Carpenter
m the original behavior with regards to unloading the driver. Calling zr364xx_stop_readpipe() on a stopped pipe is not a problem so this is safe and is potentially a bugfix. Reported-by: syzbot+b4d54814b339b5c6b...@syzkaller.appspotmail.com Signed-off-by: Dan Carpenter Tested-by: Hans Verkuil

Re: [kbuild] net/ceph/messenger_v1.c:1099:23: warning: Boolean result is used in bitwise operation. Clarify expression with parentheses.

2021-01-20 Thread Dan Carpenter
On Wed, Jan 20, 2021 at 12:01:59PM +0100, Ilya Dryomov wrote: > On Tue, Jan 19, 2021 at 8:46 PM Dan Carpenter > wrote: > > > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git > > master > > head: 1e2a199f6ccdc15cf111d

Re: [PATCH] soc: qcom: socinfo: Fix off-by-one array index bounds check

2021-01-20 Thread Dan Carpenter
There was a second one introduced recently as well. I've sent a patch for it. regards, dan carpenter

[PATCH] soc: qcom: socinfo: Fix an off by one in qcom_show_pmic_model()

2021-01-20 Thread Dan Carpenter
These need to be < ARRAY_SIZE() instead of <= ARRAY_SIZE() to prevent accessing one element beyond the end of the array. Fixes: e9247e2ce577 ("soc: qcom: socinfo: fix printing of pmic_model") Signed-off-by: Dan Carpenter --- drivers/soc/qcom/socinfo.c | 2 +- 1 file changed, 1

[kbuild] Re: [PATCH] ntp: use memset and offsetof init

2021-01-20 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: kernel/time/ntp.c:232 pps_fill_timex() warn: potential pointer math issue ('txc' is a 1664 bit pointer) vim +232 kernel

[kbuild] net/ceph/messenger_v1.c:1099:23: warning: Boolean result is used in bitwise operation. Clarify expression with parentheses.

2021-01-19 Thread Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: 1e2a199f6ccdc15cf111d68d212e2fd4ce65682e commit: 2f713615ddd9d805b6c5e79c52e0e11af99d2bf1 libceph: move msgr1 protocol implementation to its own file compiler: gcc-9 (Debian 9.3.0-15) 9.3.0 If you fix the

Re: [PATCH v17 01/10] fs/ntfs3: Add headers and misc files

2021-01-19 Thread Dan Carpenter
compare_attr() > index.c - cmp_fnames() > > So maybe we can add bool bothcases. > > int ntfs_cmp_names(const __le16 *s1, size_t l1, const __le16 *s2, size_t l2, > const u16 *upcase, bool bothcase) > { > int diff1 = 0; > int diff2; > size_t len = l1 < l2 ? l1 : l2; size_t len = min(l1, l2); I wonder if this could be a Coccinelle script? regards, dan carpenter

Re: [PATCH 6/6] wlan-ng: clean up reused macros

2021-01-19 Thread Dan Carpenter
req->basicrate[i].status = > P80211ENUM_msgitem_status_data_ok; > + } > + > + req->supprate[i].data = item->supprates[i]; > + req->supprate[i].status = > P80211ENUM_msgitem_status_data_ok; > + } > + } It's sort of surprising that we can change how we write this information but we don't have to change how it is read. I guess presumably it's just dumped as hex to debugfs or something like that... Who knows. :/ regards, dan carpenter

drivers/net/ethernet/mellanox/mlx5/core/main.c:1187 mlx5_load_one() warn: missing error code 'err'

2021-01-19 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/mellanox/mlx5/core/main.c:1187 mlx5_load_one() warn: missing error code 'err' vim +/err +1187 drivers/net

drivers/net/wireless/intel/iwlegacy/4965-mac.c:2822 il4965_hdl_tx() error: uninitialized symbol 'tid'.

2021-01-19 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/wireless/intel/iwlegacy/4965-mac.c:2822 il4965_hdl_tx() error: uninitialized symbol 'tid'. vim +/tid +2822

drivers/scsi/qedi/qedi_main.c:924 qedi_get_boot_tgt_info() error: snprintf() chops off the last chars of 256 vs 255

2021-01-19 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/scsi/qedi/qedi_main.c:924 qedi_get_boot_tgt_info() error: snprintf() chops off the last chars

Re: [PATCH v2 3/4] staging: hikey9xx: phy-hi3670-usb3.c: hi3670_is_abbclk_seleted() returns bool

2021-01-18 Thread Dan Carpenter
> > if (foo) > return true; > return false; > > should generally be consolidated into a single test. I quite prefer the original format, but you're right about the return looking reversed. Using "return !!(reg & USB_CLK_SELECTED);" is especially problematic. I like !! but Linus has commented a couple times that he doesn't like !!. regards, dan carpenter

arch/s390/pci/pci_event.c:101 __zpci_event_availability() error: we previously assumed 'zdev->zbus' could be null (see line 83)

2021-01-18 Thread Dan Carpenter
: s390-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/s390/pci/pci_event.c:101 __zpci_event_availability() error: we previously assumed 'zdev->zbus' could be null (see line

drivers/net/ethernet/intel/ixgbe/ixgbe_main.c:6580 ixgbe_setup_rx_resources() error: we previously assumed 'rx_ring->q_vector' could be null (see line 6550)

2021-01-18 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/intel/ixgbe/ixgbe_main.c:6580 ixgbe_setup_rx_resources() error: we previously assumed 'rx_ring

Re: [PATCH] media: zr364xx: fix memory leaks in probe()

2021-01-18 Thread Dan Carpenter
On Wed, Jan 13, 2021 at 05:13:41PM +0100, Hans Verkuil wrote: > Hi Dan, > > On 06/01/2021 11:10, Dan Carpenter wrote: > > Syzbot discovered that the probe error handling doesn't clean up the > > resources allocated in zr364xx_board_init(). There are several > > rel

Re: "UBSAN: shift-out-of-bounds in mceusb_dev_recv" should share the same root cause with "UBSAN: shift-out-of-bounds in mceusb_dev_printdata"

2021-01-13 Thread Dan Carpenter
ned. Also this patch can't be applied at all so it's hard to review. Read the two paragraphs of Documentation/process/email-clients.rst There are some other bugs: ir->num_txports = *hi; If "ir->num_txports" is over 31 then it will lead to undefined behavior in mceusb_set_tx_mask(). It not totally clear to me what the correct limit is. So search through the code a bit more I guess and try find the remaining bugs and what the limits should be. regards, dan carpenter

Re: [PATCH][next] ASoC: soc-pcm: Fix uninitialised return value in variable ret

2021-01-12 Thread Dan Carpenter
has two commits: > > commit 4eeed5f40354735c4e68e71904db528ed19c9cbb > Author: Souptick Joarder > Date: Sat Jan 9 09:15:01 2021 +0530 > > ASoC: soc-pcm: return correct -ERRNO in failure path > > commit e91b65b36fde0690f1c694f17dd1b549295464a7 > Author: Dan Carpenter >

Re: [PATCH][next] drm/amdgpu: Add missing BOOTUP_DEFAULT to profile_name[]

2021-01-12 Thread Dan Carpenter
ing BOOTUP_DEFAULT to profile_name[]. > Still not enough to prevent the array overflow. It needs POWERSAVE as well. regards, dan carpenter

drivers/firmware/xilinx/zynqmp.c:1288 zynqmp_firmware_remove() error: dereferencing freed memory 'feature_data'

2021-01-11 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/firmware/xilinx/zynqmp.c:1288 zynqmp_firmware_remove() error: dereferencing freed memory 'feature_data' vim

[kbuild] drivers/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c:443 sun8i_ss_hash_run() warn: possible memory leak of 'result'

2021-01-07 Thread Dan Carpenter
-elf-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/crypto/allwinner/sun8i-ss/sun8i-ss-hash.c:443 sun8i_ss_hash_run() warn: possible memory leak of 'result' vim +/result +443

Re: [PATCH] media: atomisp: ov2722: replace hardcoded function name

2021-01-07 Thread Dan Carpenter
On Wed, Jan 06, 2021 at 01:17:47PM -0800, Joe Perches wrote: > On Wed, 2021-01-06 at 22:36 +0300, Dan Carpenter wrote: > > On Wed, Jan 06, 2021 at 10:25:26AM -0800, Joe Perches wrote: > > > On Wed, 2021-01-06 at 18:52 +0100, Greg Kroah-Hartman wrote: > > > > On W

Re: [PATCH -next] media: zoran: use resource_size

2021-01-07 Thread Dan Carpenter
On Wed, Jan 06, 2021 at 09:19:58PM +0100, LABBE Corentin wrote: > Le Wed, Jan 06, 2021 at 05:51:00PM +0300, Dan Carpenter a écrit : > > On Wed, Jan 06, 2021 at 09:17:02PM +0800, Zheng Yongjun wrote: > > > Use resource_size rather than a verbose computation on > > &g

Re: [PATCH] media: atomisp: ov2722: replace hardcoded function name

2021-01-06 Thread Dan Carpenter
view! > > > > > > How do I go about this? Do I amend the patch and re-send as v2 or create a > > > new patch entirely? > > > > New patch entirely please. > > There are quite a lot of these relatively useless function tracing like > uses in the kernel: > > $ git grep -P '"%s[\.\!]*\\n"\s*,\s*__func__\s*\)' | wc -l > 1065 These are printing other stuff besides just the function name. Maybe grep for '", __func__\)'? regards, dan carpenter

Re: [PATCH] media: zr364xx: fix memory leaks in probe()

2021-01-06 Thread Dan Carpenter
On Wed, Jan 06, 2021 at 11:45:50AM -0500, Alan Stern wrote: > On Wed, Jan 06, 2021 at 01:10:05PM +0300, Dan Carpenter wrote: > > Syzbot discovered that the probe error handling doesn't clean up the > > resources allocated in zr364xx_board_init(). There are several > > related

Re: [PATCH -next] media: zoran: use resource_size

2021-01-06 Thread Dan Carpenter
t;end - start + 1"... It's sometimes hard to know if we should add the + 1 which resource_size() does or not. (That check is ancient and not up to modern standards). regards, dan carpenter

Re: [v2] net: qrtr: fix null pointer dereference in qrtr_ns_remove

2021-01-06 Thread Dan Carpenter
:/ We have asked him over and over to stop sending these sort of advice but he refused and eventually he was banned from the mailing lists. The rest of us can't see his messages to you unless we're included personally in the CC list. regards, dan carpenter

[PATCH] media: zr364xx: fix memory leaks in probe()

2021-01-06 Thread Dan Carpenter
eported-by: syzbot+b4d54814b339b5c6b...@syzkaller.appspotmail.com Signed-off-by: Dan Carpenter --- drivers/media/usb/zr364xx/zr364xx.c | 50 ++--- 1 file changed, 32 insertions(+), 18 deletions(-) diff --git a/drivers/media/usb/zr364xx/zr364xx.c b/drivers/media/usb/zr364xx/zr364x

Re: [PATCH v2 2/2] drm/bridge: anx7625: add MIPI DPI input feature support

2021-01-05 Thread Dan Carpenter
+ return 0; This s/val/0/ change seems like a bug fix. Could you please send that as a separate patch at the start of the patch set? > +} regards, dan carpenter

drivers/scsi/qedi/qedi_main.c:924 qedi_get_boot_tgt_info() error: snprintf() chops off the last chars of 256 vs 255

2021-01-05 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/scsi/qedi/qedi_main.c:924 qedi_get_boot_tgt_info() error: snprintf() chops off the last chars

Re: [PATCH] staging: android: ashmem: Declared file operation with const keyword

2021-01-05 Thread Dan Carpenter
On Mon, Dec 28, 2020 at 12:13:00AM -0500, jovin555 wrote: > Warning found by checkpatch.pl script. > > Signed-off-by: jovin555 Your Mama didn't name you "jovin555". You need to use your real name like signing a legal document. Same for the "From:" header. regards, dan carpenter

[PATCH] regmap: debugfs: Fix a reversed if statement in regmap_debugfs_init()

2021-01-05 Thread Dan Carpenter
Fix a memory leak when calling regmap_attach_dev") Signed-off-by: Dan Carpenter --- drivers/base/regmap/regmap-debugfs.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/base/regmap/regmap-debugfs.c b/drivers/base/regmap/regmap-debugfs.c index bf03cd343b

Re: [PATCH v1 2/2] drm/bridge: anx7625: add MIPI DPI input feature support

2021-01-04 Thread Dan Carpenter
nx7625_intr_hpd_isr(int irq, void > *data) > return IRQ_HANDLED; > } > > +static int anx7625_get_u32_value(struct device_node *np, > + const char *name, > + int start_pos, > + int *reg_data) > +{ > + int i, ret; > + > + /* each slot has 2 cells */ > + for (i = 0; i < 2; i++) { > + ret = of_property_read_u32_index(np, name, > + start_pos + i, > + _data[i]); > + if (ret) > + return ret; > + } > + > + return 0; > +} > + > static int anx7625_parse_dt(struct device *dev, > struct anx7625_platform_data *pdata) > { > struct device_node *np = dev->of_node; > struct drm_panel *panel; > - int ret; > + int ret, i; > + int reg_data[2]; > + int total_size, num_regs, start_pos; > + > + if (of_get_property(dev->of_node, "anx,swing-setting", _size)) { > + /* each slot has 2 cells */ > + num_regs = total_size / (sizeof(u32) * 2); > + if (num_regs > MAX_REG_SIZE) > + num_regs = MAX_REG_SIZE; > + > + pdata->reg_table_size = num_regs; > + > + for (i = 0; i < num_regs; i++) { > + start_pos = i * 2; > + ret = anx7625_get_u32_value(np, "anx,swing-setting", > + start_pos, reg_data); > + if (ret) { > + DRM_DEV_ERROR(dev, "get swing-setting at %d\n", > + start_pos); > + return -ENODEV; return ret;? regards, dan carpenter

Re: [PATCH] staging: board: Remove macro board_staging

2021-01-04 Thread Dan Carpenter
rs/staging/board/kzm9d.c > +++ b/drivers/staging/board/kzm9d.c > @@ -12,15 +12,17 @@ static struct resource usbs1_res[] __initdata = { > > static void __init kzm9d_init(void) Same. return int. > { > - board_staging_gic_setup_xlate("arm,pl390", 32); > + if (of_machine_is_compatible("renesas,kzm9d")) { Same reverse the if statement. regards, dan carpenter

Re: [PATCH v2 -next] staging: vc04_services: use DEFINE_MUTEX() for mutex lock

2021-01-04 Thread Dan Carpenter
> static void connected_init(void) > { > if (!g_once_init) { > - mutex_init(_connected_mutex); > g_once_init = 1; > } Delete the extra curly braces. regards, dan carpenter

Re: [PATCH -next] staging: vc04_services: use DEFINE_MUTEX (and mutex_init() had been too late)

2021-01-04 Thread Dan Carpenter
g_once_init; > -static struct mutex g_connected_mutex; > +static DEFINE_MUTEX(g_connected_mutex); > > /* Function to initialize our lock */ > static void connected_init(void) > { > if (!g_once_init) { > - mutex_init(_connected_mutex); >

Re: [PATCH v2 13/16] rpmsg: virtio: probe the rpmsg_ctl device

2021-01-04 Thread Dan Carpenter
-randconfig-m001-20201221 (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/rpmsg/virtio_rpmsg_bus.c:978 rpmsg_probe() error: uninitialized symbol

Re: [PATCH v3 09/24] wfx: add hwio.c/hwio.h

2021-01-04 Thread Dan Carpenter
Of course, Smatch didn't trigger any warnings in the wfx driver. I need to try re-write this check to use the cross function database so function pointers are handled. regards, dan carpenter

Re: [PATCH v3 09/24] wfx: add hwio.c/hwio.h

2021-01-04 Thread Dan Carpenter
with DMA. > > > > You should never do that because some platforms do not support it, so no > > driver should ever try to do that as they do not know what platform they > > are running on. > > Yes, I have learned this rule the hard way. > > There is no better way

drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1056 vchiq_get_user_ptr() error: uninitialized symbol 'ptr'.

2021-01-04 Thread Dan Carpenter
: 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 New smatch warnings: drivers/staging/vc04_services/interface/vchiq_arm/vchiq_arm.c:1056 vchiq_get_user_ptr() error: uninitialized symbol 'ptr

Re: [GIT PULL] NTB bug fixes for v5.11

2021-01-04 Thread Dan Carpenter
On Sun, Dec 27, 2020 at 09:38:23AM -0800, Linus Torvalds wrote: > On Sun, Dec 27, 2020 at 6:16 AM Jon Mason wrote: > > > > Wang Qing (1): > > ntb: idt: fix error check in ntb_hw_idt.c > > So this patch seems to be at least partially triggered by a smatch > warning that is a bit

Re: [PATCH] staging: greybus: fix stack size warning with UBSAN

2021-01-03 Thread Dan Carpenter
;, module->dev_id, temp_name); > > + if (w->type > ARRAY_SIZE(gbaudio_widgets)) { ^^ Off by one. >= here. > + ret = -EINVAL; > + goto error; > + } > + *dw = gbaudio_widgets[w->type]; > + dw->name = w->name; regards, dan carpenter

Re: sparse annotation for error types?

2020-12-19 Thread Dan Carpenter
l be two warnings. :) Or vs And. I've also attached the generated warnings from Friday's linux-next if you want to take a look. regards, dan carpenter sound/usb/caiaq/input.c:807 snd_usb_caiaq_input_init() warn: missing error code 'ret' sound/soc/tegra/tegra20_ac97.c:349 tegra20_ac97_platform_pr

[PATCH] nvmem: core: Fix a resource leak on error in nvmem_add_cells_from_of()

2020-12-19 Thread Dan Carpenter
This doesn't call of_node_put() on the error path so it leads to a memory leak. Fixes: 0749aa25af82 ("nvmem: core: fix regression in of_nvmem_cell_get()") Signed-off-by: Dan Carpenter --- The kfree_const() could just be replaced with kfree(). Someone got over excited converting t

[PATCH] phy: cadence-torrent: Fix error code in cdns_torrent_phy_probe()

2020-12-17 Thread Dan Carpenter
This error path should return -EINVAL, but currently it returns success. Fixes: d09945eacad0 ("phy: cadence-torrent: Check total lane count for all subnodes is within limit") Signed-off-by: Dan Carpenter --- drivers/phy/cadence/phy-cadence-torrent.c | 1 + 1 file changed, 1 insertio

[PATCH 1/3] cifs: Delete a stray unlock in cifs_swn_reconnect()

2020-12-17 Thread Dan Carpenter
The unlock is done in the caller, this is a stray which leads to a double unlock bug. Fixes: bf80e5d4259a ("cifs: Send witness register and unregister commands to userspace daemon") Signed-off-by: Dan Carpenter --- fs/cifs/cifs_swn.c | 2 -- 1 file changed, 2 deletions(-) diff --git

[kbuild] Re: [PATCH 1/7] vfio: iommu_type1: Clear added dirty bit when unwind pin

2020-12-15 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/vfio/vfio_iommu_type1.c:648 vfio_iommu_type1_pin_pages() warn: variable dereferenced before check 'iommu' (see line 640) vim +/iommu +648 drivers/vfio

Re: [PATCH] net: allwinner: Fix some resources leak in the error handling path of the probe and in the remove function

2020-12-15 Thread Dan Carpenter
On Tue, Dec 15, 2020 at 08:08:15PM +0100, Maxime Ripard wrote: > On Tue, Dec 15, 2020 at 07:18:48PM +0100, Christophe JAILLET wrote: > > Le 15/12/2020 à 12:37, Maxime Ripard a écrit : > > > On Tue, Dec 15, 2020 at 12:11:53PM +0300, Dan Carpenter wrote: > > > > On T

Re: [PATCH v2 3/5] Bluetooth: advmon offload MSFT remove monitor

2020-12-15 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: net/bluetooth/msft.h:45 msft_remove_monitor() warn: signedness bug returning '(-95)' vim +45 net/bluetooth/msft.h

Re: [PATCH] net: allwinner: Fix some resources leak in the error handling path of the probe and in the remove function

2020-12-15 Thread Dan Carpenter
es leaks. > > Do you have a source to back that? It's not clear at all from the > documentation for those functions, and couldn't find any user calling it > from the ten-or-so random picks I took. It looks like irq_create_of_mapping() needs to be freed with irq_dispose_mapping()

Re: [PATCH v2 12/12] media: atomisp: Fix LOGICAL_CONTINUATIONS

2020-12-14 Thread Dan Carpenter
sc->cb_elems || NULL == desc->cb_desc) { > > + if (NULL == qhandle || NULL == desc || > > + NULL == desc->cb_elems || NULL == desc->cb_desc) { > > /* Invalid parameters, return error*/ Delete this comment as well. It's pointless. (And the curly braces). > > return -EINVAL; > regards, dan carpenter

[PATCH] mfd: wm831x-auxadc: Prevent use after free in wm831x_auxadc_read_irq()

2020-12-14 Thread Dan Carpenter
ot;mfd: Support multiple active WM831x AUXADC conversions") Signed-off-by: Dan Carpenter --- drivers/mfd/wm831x-auxadc.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/mfd/wm831x-auxadc.c b/drivers/mfd/wm831x-auxadc.c index 8a7cc0f86958..65b98f3fbd92 100644 ---

[PATCH] fs/adfs: bigdir: Fix another error code in adfs_fplus_read()

2020-12-14 Thread Dan Carpenter
This should return -EINVAL if the checkbyte is wrong instead of success. Fixes: d79288b4f61b ("fs/adfs: bigdir: calculate and validate directory checkbyte") Signed-off-by: Dan Carpenter --- Sorry for not catching this one last time. :/ fs/adfs/dir_fplus.c | 1 + 1 file changed, 1

Re: [PATCH] net: mscc: ocelot: Fix a resource leak in the error handling path of the probe function

2020-12-14 Thread Dan Carpenter
t switch probed\n"); 1286 1287 out_put_ports: 1288 of_node_put(ports); 1289 return err; 1290 } regards, dan carpenter

Re: [PATCH AUTOSEL 5.9 15/23] scsi: storvsc: Validate length of incoming packet in storvsc_on_channel_callback()

2020-12-14 Thread Dan Carpenter
up for failure by not including a fixes tag so we'd also have to search for: This reverts commit 3b8c72d076c42bf27284cda7b2b2b522810686f8. regards, dan carpenter

Re: mmc: atmel-mci: Reduce scope for the variable “slot” in atmci_request_end()

2020-12-13 Thread Dan Carpenter
ction is very long. regards, dan carpenter

Re: [PATCH] mmc: atmel-mci: Reduce scope for the variable “slot” in atmci_request_end()

2020-12-11 Thread Dan Carpenter
Markus was banned from vger at the end of July after ignoring repeated warnings. This makes it hard to review any patches or follow discussion... regards, dan carpenter

Re: [PATCH v1 1/2] Staging: silabs si4455 serial driver: fix directory structure and coding style

2020-12-10 Thread Dan Carpenter
"%s(%u): SI4455_IOC_SEZC, length(%i)", > + _

Re: Re: [PATCH] staging: rtl8712: check register_netdev() return value

2020-12-10 Thread Dan Carpenter
If no need to change drivers/staging/rtl8712/hal_init.c file, I could > give up my patch, thank you ! > Cleaning this up is a bit complicated and requires reworking the firmware loading and it requires testing. I don't think you have the hardware to actually test this driver? Probably, just leave this code for another day. regards, dan carpenter

[kbuild] drivers/firmware/qcom_scm.c:181:12: warning: Redundant condition: cpus. '!cpus || (cpus && cpumask_empty(cpus))' is equivalent to '!cpus || cpumask_empty(cpus)'

2020-12-10 Thread Dan Carpenter
tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master head: a2f5ea9e314ba6778f885c805c921e9362ec0420 commit: 57d3b816718c1cf832e2929a754da3564c6127cc firmware: qcom_scm: Remove thin wrappers compiler: aarch64-linux-gcc (GCC) 9.3.0 If you fix the issue, kindly add

Re: [PATCH] Staging: silabs si4455 serial driver

2020-12-10 Thread Dan Carpenter
aIn); > > > > > + if (ret == 0) { > > > + result->CHIPREV = dataIn[0]; > > > + memcpy(>PART, [1],sizeof(result->PART)); > > > + result->PBUILD = dataIn[3]; > > > + memcpy(>ID, [4], sizeof(result->ID)); > > > + result->CUSTOMER = dataIn[6]; > > > + result->ROMID = dataIn[7]; > > > + result->BOND = dataIn[8]; > > > > ... it would avoid all these lines. > > regards, dan carpenter

Re: [PATCH] Staging: silabs si4455 serial driver

2020-12-09 Thread Dan Carpenter
mail client on my linux dev environment, I hope my > mails/patches/codes will be in proper quality in the future. No problem at all. Part of getting used to the process. regards, dan carpenter

Re: [PATCH] staging: rtl8712: check register_netdev() return value

2020-12-09 Thread Dan Carpenter
) != 0) { > + netdev_err(adapter->pnetdev, "register_netdev() failed\n"); > + free_netdev(adapter->pnetdev); > + } This function should not be calling register_netdev(). What does that have to do with firmware? It should also not free_netdev

Re: [PATCH] Staging: silabs si4455 serial driver

2020-12-09 Thread Dan Carpenter
Change the From email header to say your name. The patch is corrupted and can't be applied. Please read the first paragraphs of Documentation/process/email-clients.rst This driver is pretty small and it might be easier to clean it up first before merging it into staging. Run checkpatch.pl

Re: [Ksummit-discuss] crediting bug reports and fixes folded into original patch

2020-12-09 Thread Dan Carpenter
On Wed, Dec 09, 2020 at 12:54:30AM -0800, Joe Perches wrote: > On Wed, 2020-12-09 at 10:58 +0300, Dan Carpenter wrote: > > On Tue, Dec 08, 2020 at 09:01:49PM -0800, Joe Perches wrote: > > > On Tue, 2020-12-08 at 16:34 -0800, Kees Cook wrote: > > > > > > > If

Re: [Ksummit-discuss] crediting bug reports and fixes folded into original patch

2020-12-09 Thread Dan Carpenter
t. Then to make me redo the patch in an ugly style and say thankyou on top of that??? Forget about it. Plus, as a reviewer I hate reviewing patches over and over. I've argued for years that we should have a Fixes-from: tag. The zero day bot is already encouraging people to add Reported-by tags for this and a lot of people do. regards, dan carpenter

[PATCH] kexec: Fix error code in kexec_calculate_store_digests()

2020-12-08 Thread Dan Carpenter
Return -ENOMEM on allocation failure instead of returning success. Fixes: a43cac0d9dc2 ("kexec: split kexec_file syscall code to kexec_file.c") Signed-off-by: Dan Carpenter --- kernel/kexec_file.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/kernel/kexe

Re: sparse annotation for error types?

2020-12-08 Thread Dan Carpenter
is_last = is_last_stmt(stmt); name = expr_to_str(stmt->ret_value); sm_warning("missing error code '%s' rl='%s' is_last=%d", name, sm->state->name, is_last); free_string(name); } regards, dan carpenter

Re: [PATCH 06/12] media: atomisp: Add parentheses

2020-12-08 Thread Dan Carpenter
k the build. You should just remove these defines. They don't make any sort of sense. The programmer should know what things need to be static and what not. Generally leave "inline" out, and let the compiler decide. If you have a legit reason to think you are smarter than the compiler (b

Re: [PATCH 01/12] media: atomsip: Convert comments to C99 initializers

2020-12-08 Thread Dan Carpenter
/* index */ > - NULL, /* handles */ > + .copy_on_write = false, > + .recycle= false, > + .size = 0, > + .index = 0, > + .handles= NULL, If you're using C99 initializers then you can remove all the false, 0 and NULL members. regards, dan carpenter

[PATCH] regulator: da9121: Potential Oops in da9121_assign_chip_model()

2020-12-07 Thread Dan Carpenter
There is a missing "return ret;" on this error path so we call "da9121_check_device_type(i2c, chip);" which will end up dereferencing "chip->regmap" and lead to an Oops. Fixes: c860476b9e3a ("regulator: da9121: Add device variant regmaps") Signed-of

Re: [PATCH] x86/sgx: Return -EINVAL on a zero length buffer in sgx_ioc_enclave_add_pages()

2020-12-03 Thread Dan Carpenter
t; Cc: Dave Hansen > Cc: Borislav Petkov > Link: https://lore.kernel.org/linux-sgx/X8ehQssnslm194ld@mwanda/ > Fixes: c6d26d370767 ("x86/sgx: Add SGX_IOC_ENCLAVE_ADD_PAGES") > Reported-by: Dan Carpenter > Signed-off-by: Jarkko Sakkinen Acked-by: Dan Carpenter regards, dan carpenter

Re: [PATCH 01/11] drivers: staging: speakup: remove unneeded MODULE_VERSION() call

2020-12-03 Thread Dan Carpenter
d-off-by: Enrico Weigelt > > --- > > drivers/accessibility/speakup/main.c | 1 - > > > > Yous subject line is odd, these are not "staging" drivers anymore, so > why do you say they are there? Also putting "drivers:" in the subject always seems superfluous. regards, dan carpenter

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

2020-12-03 Thread Dan Carpenter
nment. Fixes: 38b2db564d9a ("scsi: be2iscsi: Fix a theoretical leak in beiscsi_create_eqs()") Reported-by: Thomas Lamprecht Signed-off-by: Dan Carpenter --- My original patch was basically a clean up patch and to try silence a static checker warning. I've already updated the static checker to no

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

2020-12-03 Thread Dan Carpenter
ation we would want to store > > the "paddr" so that dma memory can be released. > > > > Fixes: bfead3b2cb46 ("[SCSI] be2iscsi: Adding msix and mcc_rings V3") > > Signed-off-by: Dan Carpenter > > This came in here through the stable 5.4 tree with v5.

Re: arch/s390/pci/pci_event.c:101 __zpci_event_availability() error: we previously assumed 'zdev->zbus' could be null (see line 83)

2020-12-03 Thread Dan Carpenter
On Thu, Dec 03, 2020 at 11:52:48AM +0100, Niklas Schnelle wrote: > > > On 12/3/20 11:27 AM, Dan Carpenter wrote: > > tree: https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git > > master > > head: 3bb61aa61828499a7d0f5e56

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