[PATCH] scsi: be2iscsi: Reset the address passed in beiscsi_iface_create_default

2021-04-06 Thread Aditya Pakki
if_info is a local variable that is passed to beiscsi_if_get_info. In case of failure, the variable is free'd but not reset to NULL. The patch avoids security issue by passing NULL to if_info. Signed-off-by: Aditya Pakki --- drivers/scsi/be2iscsi/be_iscsi.c | 2 ++ 1 file changed, 2 insertions

[PATCH] SUNRPC: Add a check for gss_release_msg

2021-04-06 Thread Aditya Pakki
In gss_pipe_destroy_msg(), in case of error in msg, gss_release_msg deletes gss_msg. The patch adds a check to avoid a potential double free. Signed-off-by: Aditya Pakki --- net/sunrpc/auth_gss/auth_gss.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/sunrpc/auth_gss

[PATCH] net/rds: Avoid potential use after free in rds_send_remove_from_sock

2021-04-06 Thread Aditya Pakki
In case of rs failure in rds_send_remove_from_sock(), the 'rm' resource is freed and later under spinlock, causing potential use-after-free. Set the free pointer to NULL to avoid undefined behavior. Signed-off-by: Aditya Pakki --- net/rds/message.c | 1 + net/rds/send.c| 2 +- 2 files

[PATCH] fuse: Avoid potential use after free

2021-04-06 Thread Aditya Pakki
In virtio_fs_get_tree, after fm is freed, it is again freed in case s_root is NULL and virtio_fs_fill_super() returns an error. To avoid a double free, set fm to NULL. Signed-off-by: Aditya Pakki --- fs/fuse/virtio_fs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/fs/fuse/virtio_fs.c b

[PATCH] video: fbdev: sm501fb: Fix deallocation of buffers order

2021-04-06 Thread Aditya Pakki
The resource release in sm501fb_remove() is not in the inverse order of sm501fb_probe(), for the buffers. Release the info object after deallocating the buffers. Signed-off-by: Aditya Pakki --- drivers/video/fbdev/sm501fb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git

[PATCH v2] RDMA/rvt: Fix potential memory leak caused by rvt_alloc_rq

2020-06-13 Thread Aditya Pakki
In case of failure of alloc_ud_wq_attr(), the memory allocated by rvt_alloc_rq() is not freed. Fix it by calling rvt_free_rq() using the existing clean-up code. Fixes: d310c4bf8aea ("IB/{rdmavt, hfi1, qib}: Remove AH refcount for UD QPs") Signed-off-by: Aditya Pakki --- v1: Fix incor

[PATCH] media: st-delta: Fix reference count leak in delta_run_work

2020-06-13 Thread Aditya Pakki
delta_run_work() calls delta_get_sync() that increments the reference counter. In case of failure, decrement the reference count by calling delta_put_autosuspend(). Signed-off-by: Aditya Pakki --- drivers/media/platform/sti/delta/delta-v4l2.c | 4 +++- 1 file changed, 3 insertions(+), 1

[PATCH] media: bdisp: fix reference count leaks due to pm_runtime_get_sync

2020-06-13 Thread Aditya Pakki
On calling pm_runtime_get_sync() the reference count of the device is incremented. In case of failure, decrement the reference count before returning the error. Signed-off-by: Aditya Pakki --- drivers/media/platform/sti/bdisp/bdisp-v4l2.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion

[PATCH] mtd: rawnand: gpmi: fix reference count leak due to pm_runtime_get_sync

2020-06-13 Thread Aditya Pakki
On calling pm_runtime_get_sync() the reference count of the device is incremented. In case of failure, decrement the reference count before returning the error. Signed-off-by: Aditya Pakki --- drivers/mtd/nand/raw/gpmi-nand/gpmi-nand.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions

[PATCH] hwmon: (ina3221) Fix reference count leak in ina3221_write_enable

2020-06-13 Thread Aditya Pakki
ina3221_write_enable() calls pm_runtime_get_sync() that increments the reference counter. In case of failure, decrement the reference count and return the error. Signed-off-by: Aditya Pakki --- drivers/hwmon/ina3221.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/hwmon/ina3221.c b

[PATCH] usb: core: fix reference count leak in usb_port_resume

2020-06-13 Thread Aditya Pakki
usb_port_resume() calls pm_runtime_get_sync() that increments the reference counter. In case of failure, decrement the reference count and return the error. Signed-off-by: Aditya Pakki --- drivers/usb/core/hub.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/core/hub.c b

[PATCH] usb: musb: fix reference count leak in musb_irq_work

2020-06-13 Thread Aditya Pakki
musb_irq_work() calls pm_runtime_get_sync() that increments the reference counter. In case of failure, decrement the reference count and return the error. Signed-off-by: Aditya Pakki --- drivers/usb/musb/musb_core.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/usb/musb

[PATCH] usb: dwc3: pci: Fix reference count leak in dwc3_pci_resume_work

2020-06-13 Thread Aditya Pakki
dwc3_pci_resume_work() calls pm_runtime_get_sync() that increments the reference counter. In case of failure, decrement the reference count and return the error. Signed-off-by: Aditya Pakki --- drivers/usb/dwc3/dwc3-pci.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git

[PATCH] omapfb: fix multiple reference count leaks due to pm_runtime_get_sync

2020-06-13 Thread Aditya Pakki
On calling pm_runtime_get_sync() the reference count of the device is incremented. In case of failure, decrement the reference count before returning the error. Signed-off-by: Aditya Pakki --- drivers/video/fbdev/omap2/omapfb/dss/dispc.c | 7 +-- drivers/video/fbdev/omap2/omapfb/dss/dsi.c

[PATCH] drm/v3d: fix reference count leaks due to pm_runtime_get_sync

2020-06-13 Thread Aditya Pakki
On calling pm_runtime_get_sync() the reference count of the device is incremented. In case of failure, decrement the reference count before returning the error. Signed-off-by: Aditya Pakki --- drivers/gpu/drm/v3d/v3d_debugfs.c | 8 ++-- drivers/gpu/drm/v3d/v3d_drv.c | 4 +++- drivers

[PATCH] drm/bridge: fix reference count leaks due to pm_runtime_get_sync()

2020-06-13 Thread Aditya Pakki
On calling pm_runtime_get_sync() the reference count of the device is incremented. In case of failure, decrement the reference count before returning the error. Signed-off-by: Aditya Pakki --- drivers/gpu/drm/bridge/cdns-dsi.c | 8 ++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff

[PATCH] drm/radeon: Fix reference count leaks caused by pm_runtime_get_sync

2020-06-13 Thread Aditya Pakki
On calling pm_runtime_get_sync() the reference count of the device is incremented. In case of failure, decrement the reference count before returning the error. Signed-off-by: Aditya Pakki --- drivers/gpu/drm/radeon/radeon_display.c | 4 +++- drivers/gpu/drm/radeon/radeon_drv.c | 4

[PATCH] drm/radeon: fix multiple reference count leak

2020-06-13 Thread Aditya Pakki
On calling pm_runtime_get_sync() the reference count of the device is incremented. In case of failure, decrement the reference count before returning the error. Signed-off-by: Aditya Pakki --- drivers/gpu/drm/radeon/radeon_connectors.c | 20 +++- 1 file changed, 15 insertions

[PATCH] drm/noveau: fix reference count leak in nouveau_debugfs_strap_peek

2020-06-13 Thread Aditya Pakki
nouveau_debugfs_strap_peek() calls pm_runtime_get_sync() that increments the reference count. In case of failure, decrement the ref count before returning the error. Signed-off-by: Aditya Pakki --- drivers/gpu/drm/nouveau/nouveau_debugfs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion

[PATCH] drm/nouveau: fix multiple instances of reference count leaks

2020-06-13 Thread Aditya Pakki
On calling pm_runtime_get_sync() the reference count of the device is incremented. In case of failure, decrement the ref count before returning the error. Signed-off-by: Aditya Pakki --- drivers/gpu/drm/nouveau/nouveau_drm.c | 8 ++-- drivers/gpu/drm/nouveau/nouveau_gem.c | 4 +++- 2 files

[PATCH] drm/noveau: fix reference count leak in nouveau_fbcon_open

2020-06-13 Thread Aditya Pakki
nouveau_fbcon_open() calls calls pm_runtime_get_sync() that increments the reference count. In case of failure, decrement the ref count before returning the error. Signed-off-by: Aditya Pakki --- drivers/gpu/drm/nouveau/nouveau_fbcon.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion

[PATCH] drm/noveau: fix reference count leak in nv50_disp_atomic_commit

2020-06-13 Thread Aditya Pakki
nv50_disp_atomic_commit() calls calls pm_runtime_get_sync and in turn increments the reference count. In case of failure, decrement the ref count before returning the error. Signed-off-by: Aditya Pakki --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 4 +++- 1 file changed, 3 insertions(+), 1

[PATCH] drm/nouveau: Fix reference count leak in nouveau_connector_detect

2020-06-13 Thread Aditya Pakki
nouveau_connector_detect() calls pm_runtime_get_sync and in turn increments the reference count. In case of failure, decrement the ref count before returning the error. Signed-off-by: Aditya Pakki --- drivers/gpu/drm/nouveau/nouveau_connector.c | 4 +++- 1 file changed, 3 insertions(+), 1

[PATCH] net: Fix a potential incorrect error handling in rawsock_connect

2020-06-12 Thread Aditya Pakki
In rawsock_connect, the device is allocated by calling nfc_get_device. In case of incorrect bounds index, the device should be freed by calling nfc_put_device. The patch fixes this issue. Signed-off-by: Aditya Pakki --- net/nfc/rawsock.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion

[PATCH] rocker: fix incorrect error handling in dma_rings_init

2020-06-12 Thread Aditya Pakki
In rocker_dma_rings_init, the goto blocks in case of errors caused by the functions rocker_dma_cmd_ring_waits_alloc() and rocker_dma_ring_create() are incorrect. The patch fixes the order consistent with cleanup in rocker_dma_rings_fini(). Signed-off-by: Aditya Pakki --- drivers/net/ethernet

[PATCH] net: ethernet: Fix potential memory leak caused in error handling

2020-06-12 Thread Aditya Pakki
In ethoc_probe, a failure of mdiobus_register() does not release the memory allocated by mdiobus_alloc. The patch fixes this issue. Signed-off-by: Aditya Pakki --- drivers/net/ethernet/ethoc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/ethoc.c b

[PATCH] test_objagg: Fix potential memory leak in error handling

2020-06-12 Thread Aditya Pakki
In case of failure of check_expect_hints_stats(), the resources allocated by objagg_hints_get should be freed. The patch fixes this issue. Signed-off-by: Aditya Pakki --- lib/test_objagg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/test_objagg.c b/lib

[PATCH] RDMA/rvt: Fix potential memory leak caused by rvt_alloc_rq

2020-06-12 Thread Aditya Pakki
In case of failure of alloc_ud_wq_attr, the memory allocated by rvt_alloc_rq() is not freed. The patch fixes this issue by calling rvt_free_rq(). Signed-off-by: Aditya Pakki --- drivers/infiniband/sw/rdmavt/qp.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/infiniband/sw/rdmavt

[PATCH v2] ata: dwc_460ex: Avoid potential NULL pointer dereference

2019-03-25 Thread Aditya Pakki
dma_async_tx_descriptor can contain a NULL variable and using it in dmaengine_submit without checking can crash the process. This patch avoids such a scenario. Signed-off-by: Aditya Pakki --- v1: Return error in case of failure to desc variable to avoid hang up. --- drivers/ata

[PATCH v6] tty: 8250: fix a missing check for pci_ioremap_bar

2019-03-25 Thread Aditya Pakki
pci_ioremap_bar could fail. The patch returns in case of failure to acquire IOMEM. It also releases the acquired resource in the exit path. Signed-off-by: Aditya Pakki --- v5: change pci_iounmap to iounmap to pass kbuild errors in other arch v4: Missed resource release in dma_probe failure. v3

[PATCH v4] nvdimm: btt_devs: fix a NULL pointer dereference

2019-03-25 Thread Aditya Pakki
In case kmemdup fails, the fix releases resources and returns to avoid the NULL pointer dereference. Signed-off-by: Aditya Pakki --- v3: Move kfree(nd_btt) to goto block. v2: Replace incorrect kfree with ida_simple_remove, suggested by Johannes Thumshirn v1: Free nd_btt->id in case of fail

[PATCH v3] thunderbolt: Fix to check the return value of kmemdup

2019-03-25 Thread Aditya Pakki
uuid in add_switch is allocted via kmemdup which can fail. The patch logs the error and cleans up the allocated memory for switch. Signed-off-by: Aditya Pakki --- v2: replace WARN_ONCE with tb_sw_warn, as suggested by Mika v1: Change warn_once to return after clean up. --- drivers/thunderbolt

[PATCH v5] tty: 8250: fix a missing check for pci_ioremap_bar

2019-03-24 Thread Aditya Pakki
pci_ioremap_bar could fail. The patch returns in case of failure to acquire IOMEM. It also releases the acquired resource in the exit path. Signed-off-by: Aditya Pakki --- v4: Missed resource release in dma_probe failure. v3: Change the order of pci_iounmap and dw_dma_remove v2: Failed

Re: [PATCH] ata: dwc_460ex: Avoid potential NULL pointer dereference

2019-03-24 Thread Aditya Pakki
On 3/24/19 11:28 AM, Jens Axboe wrote: > On 3/4/19 4:08 PM, Aditya Pakki wrote: >> dma_async_tx_descriptor can contain a NULL variable and using >> it in dmaengine_submit without checking can crash the process. >> This patch avoids such a scenario. >> >

[PATCH v4] tty: 8250: fix a missing check for pci_ioremap_bar

2019-03-24 Thread Aditya Pakki
pci_ioremap_bar could fail. The patch returns in case of failure to acquire IOMEM. It also releases the acquired resource in the exit path. Signed-off-by: Aditya Pakki --- v3: Change the order of pci_iounmap and dw_dma_remove v2: Failed to release resource in exit path and incorrect code in non

[PATCH v3] tty: 8250: fix a missing check for pci_ioremap_bar

2019-03-24 Thread Aditya Pakki
pci_ioremap_bar could fail. The patch returns in case of failure to acquire IOMEM. It also releases the acquired resource in the exit path. Signed-off-by: Aditya Pakki --- v2: Failed to release resource in exit path and incorrect code in non DMA case, suggested by Andy Shevchenko v1: Missed

Re: [PATCH] sound: rt5645: fix a NULL pointer dereference

2019-03-23 Thread Aditya Pakki
On 3/14/19 10:48 PM, Kangjie Lu wrote: > devm_kcalloc() may fail and return NULL. The fix returns ENOMEM > in case it fails to avoid NULL pointer dereference. > > Signed-off-by: Kangjie Lu > --- > sound/soc/codecs/rt5645.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git

[PATCH v2] tty: 8250: fix a missing check for pci_ioremap_bar

2019-03-23 Thread Aditya Pakki
pci_ioremap_bar could fail. The fix captures the failure and pass an error code upstream. This can avoid potential NULL pointer dereferences in the future. Signed-off-by: Aditya Pakki --- v1: Missed return by default in CONFIG_SERIAL_8250_DMA, suggested by Jiri Slaby --- drivers/tty/serial

Re: [PATCH] pinctrl: axp209: Fix NULL pointer dereference after allocation

2019-03-23 Thread Aditya Pakki
Gentle reminder, Can someone review this patch. On 3/12/19 10:19 AM, Aditya Pakki wrote: > axp20x_build_funcs_groups allocates groups via devm_kcalloc and tries to > dereference without checking for NULL. This patch avoids such a > scenario. > > Signed-off-by: Aditya Pakki &

[PATCH v2] pci: pcie-xilinx: fix a missing-check bug for __get_free_pages

2019-03-23 Thread Aditya Pakki
In case __get_free_pages fail, the fix returns error upstream to avoid NULL pointer dereference. Signed-off-by: Aditya Pakki --- v1: Return error upstream as suggested by Steven --- drivers/pci/controller/pcie-xilinx.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff

[PATCH v2] thunderbolt: Fix to check the return value of kmemdup

2019-03-23 Thread Aditya Pakki
uuid in add_switch is allocted via kmemdup which can fail. The patch logs the error and cleans up the allocated memory for switch. Signed-off-by: Aditya Pakki --- v1: Change error handling from WARN_ONCE to return after clean up. --- drivers/thunderbolt/icm.c | 5 + 1 file changed, 5

[PATCH v3] ASoC: sirf-audio: Remove redundant of_match_node call

2019-03-22 Thread Aditya Pakki
Unlike other drivers probe method, of_match_node return value is not used or checked. This patch removes the redundant code. Signed-off-by: Aditya Pakki --- v2: Move the signed by above the version change log v1: A check is unnecessary as match is never used. --- sound/soc/codecs/sirf-audio

[PATCH v2] firmware: arm_scmi: Fix to replace of_match_device

2019-03-22 Thread Aditya Pakki
of_match_device can return NULL if no matching device is found. This patch replaces the function with of_device_get_match_data. and returns -EINVAL in such a scenario. Signed-off-by: Aditya Pakki --- v1: Replace of_match_device with of_device_get_match_data --- drivers/firmware/arm_scmi

[tip:x86/urgent] x86/hpet: Prevent potential NULL pointer dereference

2019-03-21 Thread tip-bot for Aditya Pakki
Commit-ID: 2e84f116afca3719c9d0a1a78b47b48f75fd5724 Gitweb: https://git.kernel.org/tip/2e84f116afca3719c9d0a1a78b47b48f75fd5724 Author: Aditya Pakki AuthorDate: Mon, 18 Mar 2019 21:19:56 -0500 Committer: Thomas Gleixner CommitDate: Thu, 21 Mar 2019 12:24:38 +0100 x86/hpet: Prevent

[PATCH v3] staging: rtl8188eu: Fix potential NULL pointer dereference of kcalloc

2019-03-20 Thread Aditya Pakki
hwxmits is allocated via kcalloc and not checked for failure before its dereference. The patch fixes this problem by returning error upstream in rtl8723bs, rtl8188eu. Signed-off-by: Aditya Pakki --- v2: Move signed off above version change log. v1: Return error and remove print in case

[PATCH v3] staging: rtlwifi: rtl8822b: fix to avoid NULL pointer dereference

2019-03-20 Thread Aditya Pakki
skb allocated via dev_alloc_skb can fail and return a NULL pointer. This patch avoids such a scenario and returns, consistent with other invocations. Signed-off-by: Aditya Pakki --- v2: Move signed off above the version change log v1: Patch collision with rtl_phydm.c, fix as per Greg

[PATCH v3] thunderbolt: Fix to check return value of ida_simple_get

2019-03-20 Thread Aditya Pakki
In enumerate_services, ida_simple_get on failure can return an error and leaks memory. The patch ensures that the dev_set_name is set on non failure cases, and releases memory during failure. Signed-off-by: Aditya Pakki --- v2: Remove kfree in device_register failure v1: Missed cleanup of svc

[PATCH v2] thunderbolt: Fix to check return value of ida_simple_get

2019-03-20 Thread Aditya Pakki
In enumerate_services, ida_simple_get on failure can return an error and leaks memory during device_register failure. The patch ensures that the dev_set_name is set on non failure cases, and releases memory in case of failure. Signed-off-by: Aditya Pakki --- v1: Missed cleanup of svc in case

[PATCH v2] thunderbolt: Fix to check for kmemdup failure

2019-03-20 Thread Aditya Pakki
Memory allocated via kmemdup might fail and return a NULL pointer. This patch adds a check on the return value of kmemdup and passes the error upstream. Signed-off-by: Aditya Pakki --- v1: Missed check on tb_sw_read, suggested by Mukesh --- drivers/thunderbolt/switch.c | 22

[PATCH v3] staging: rtlwifi: Fix potential NULL pointer dereference of kzalloc

2019-03-20 Thread Aditya Pakki
phydm.internal is allocated using kzalloc which is used multiple times without a check for NULL pointer. This patch avoids such a scenario by returning 0, consistent with the failure case. Signed-off-by: Aditya Pakki --- v2: Move the signed off line above v1: Patch collision with different

[PATCH v2] ASoC: sirf-audio: Remove redundant of_match_node call

2019-03-19 Thread Aditya Pakki
Unlike other drivers probe method, of_match_node return value is not used or checked. This patch removes the redundant code. --- v1: A check is unnecessary as match is never used. Signed-off-by: Aditya Pakki --- sound/soc/codecs/sirf-audio-codec.c | 3 --- 1 file changed, 3 deletions(-) diff

[PATCH v2] staging: rtl8188eu: Fix potential NULL pointer dereference

2019-03-19 Thread Aditya Pakki
hwxmits is allocated via kcalloc and not checked for failure before its dereference. The patch fixes this problem by returning an error in rtl8723bs. --- v1: Return error and remove print in case of failure, per Greg Signed-off-by: Aditya Pakki --- drivers/staging/rtl8188eu/core/rtw_xmit.c

[PATCH v2] staging: rtlwifi: rtl8822b: fix to avoid NULL pointer dereference

2019-03-19 Thread Aditya Pakki
skb allocated via dev_alloc_skb can fail and return a NULL pointer. This patch avoids such a scenario and returns, consistent with other invocations. --- v1: Patch collision with rtl_phydm.c, fix as per Greg Signed-off-by: Aditya Pakki --- drivers/staging/rtlwifi/rtl8822be/fw.c | 2 ++ 1 file

[PATCH v2] staging: rtlwifi: Fix potential NULL pointer dereference of kzalloc

2019-03-19 Thread Aditya Pakki
phydm.internal is allocated using kzalloc which is used multiple times without a check for NULL pointer. This patch avoids such a scenario. -- v1: Patch collision with different things, fix as per Greg Signed-off-by: Aditya Pakki --- drivers/staging/rtlwifi/phydm/rtl_phydm.c | 2 ++ 1 file

[PATCH] fmc: fix to avoid NULL pointer dereference

2019-03-19 Thread Aditya Pakki
kmemdup can fail to allocate memory and result in a NULL pointer dereference. The patches avoids such a scenario. Signed-off-by: Aditya Pakki --- drivers/fmc/fmc-fakedev.c | 8 1 file changed, 8 insertions(+) diff --git a/drivers/fmc/fmc-fakedev.c b/drivers/fmc/fmc-fakedev.c index

[PATCH] thunderbolt: Fix to check the return value of kmemdup

2019-03-19 Thread Aditya Pakki
uuid in add_switch is allocted via kmemdup which can fail. The patch logs the error in such a scenario. Signed-off-by: Aditya Pakki --- drivers/thunderbolt/icm.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/thunderbolt/icm.c b/drivers/thunderbolt/icm.c index e3fc920af682

[PATCH] thunderbolt: Fix to check return value of ida_simple_get

2019-03-19 Thread Aditya Pakki
ida_simple_get on failure can return an error. The patch ensures that the dev_set_name is set on non failure cases. Signed-off-by: Aditya Pakki --- drivers/thunderbolt/xdomain.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/thunderbolt/xdomain.c b/drivers

[PATCH] thunderbolt: Fix to check return value of ida_simple_get

2019-03-19 Thread Aditya Pakki
ida_simple_get on failure can return an error. The patch ensures that the dev_set_name is set on non failure cases. Signed-off-by: Aditya Pakki --- drivers/thunderbolt/xdomain.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/thunderbolt/xdomain.c b/drivers

[PATCH] udf: Fix to check the return value of load_nls

2019-03-18 Thread Aditya Pakki
load_nls may fail and return an error message. The patch checks for such a scenario and passes the error upstream. Signed-off-by: Aditya Pakki --- fs/udf/super.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/fs/udf/super.c b/fs/udf/super.c index ffd8038ff728..1a38271de6d9 100644

[PATCH] x86: hpet: Fix to avoid potential NULL pointer dereference

2019-03-18 Thread Aditya Pakki
hpet_virt_address may be NULL when ioremap_nocache fails. The patch checks for such a scenario and avoids NULL pointer dereference. Signed-off-by: Aditya Pakki --- arch/x86/kernel/hpet.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/x86/kernel/hpet.c b/arch/x86/kernel/hpet.c index

[PATCH v2] mmc: dw_mmc: Fix to avoid potential NULL pointer dereference

2019-03-18 Thread Aditya Pakki
of_match_node can fail and return NULL in case no matching structure. The patches checks for such a scenario and returns -ENXIO. --- V1: Added files dw_mmc-zx.c and dw_mmc-rockchip.c Signed-off-by: Aditya Pakki --- drivers/mmc/host/dw_mmc-exynos.c | 2 ++ drivers/mmc/host/dw_mmc-k3.c

[PATCH] slimbus: ngd: Fix to avoid potential NULL pointer dereference

2019-03-18 Thread Aditya Pakki
In of_qcom_slim_ngd_register, of_match_node may fail and return a NULL pointer. This patch avoids such a scenario leading to NULL pointer dereference. Fixes: 458a445deb9c ("slimbus: ngd: Fix build error on x86") Signed-off-by: Aditya Pakki --- drivers/slimbus/qcom-ngd-ctrl.c | 2

[PATCH] ASoC: codecs: Fix to avoid potential NULL pointer dereferences

2019-03-18 Thread Aditya Pakki
In sirf_audio_codec_driver_probe, of_match_node may fail and return a NULL pointer. The patch avoids a potential NULL pointer dereference. Signed-off-by: Aditya Pakki --- sound/soc/codecs/sirf-audio-codec.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/soc/codecs/sirf-audio

[PATCH] PCI: Fix to avoid potential NULL pointer dereference

2019-03-18 Thread Aditya Pakki
In gen_pci_probe, of_match_node can return a NULL pointer in case of failure. The patch avoids a NULL pointer dereference in such a scenario. Signed-off-by: Aditya Pakki --- drivers/pci/controller/pci-host-generic.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pci/controller

[PATCH] mmc: dw_mmc: Fix to avoid potential NULL pointer dereference

2019-03-18 Thread Aditya Pakki
of_match_node can fail and return NULL in case no matching structure. The patches checks for such a scenario and returns -ENXIO. Signed-off-by: Aditya Pakki --- drivers/mmc/host/dw_mmc-exynos.c | 2 ++ drivers/mmc/host/dw_mmc-k3.c | 2 ++ drivers/mmc/host/dw_mmc-pltfm.c | 2 ++ 3 files

[PATCH] serial: mvebu-uart: Fix to avoid a potential NULL pointer dereference

2019-03-18 Thread Aditya Pakki
of_match_device on failure to find a matching device can return a NULL pointer. The patch checks for such a scenrio and passes the error upstream. Signed-off-by: Aditya Pakki --- drivers/tty/serial/mvebu-uart.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/tty/serial/mvebu

[PATCH] serial: max310x: Fix to avoid potential NULL pointer dereference

2019-03-18 Thread Aditya Pakki
of_match_device can return a NULL pointer when matching device is not found. This patch avoids a scenario causing NULL pointer derefernce. Signed-off-by: Aditya Pakki --- drivers/tty/serial/max310x.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/tty/serial/max310x.c b/drivers

[PATCH] pinctrl: berlin: as370: Fix to avoid NULL pointer dereference

2019-03-18 Thread Aditya Pakki
of_match_device in as370_pinctrl_probe can return a NULL value when the matching device is not found. The patch avoids a potential dereference in such scenario. Signed-off-by: Aditya Pakki --- drivers/pinctrl/berlin/pinctrl-as370.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers

[PATCH] pinctrl: berlin: Fix to avoid NULL pointer dereference

2019-03-18 Thread Aditya Pakki
of_match_device can return a NULL value when the matching device is not found. The patch avoids a potential dereference in such scenario. Signed-off-by: Aditya Pakki --- drivers/pinctrl/berlin/berlin-bg4ct.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/pinctrl/berlin/berlin

[PATCH] mtd: rawnand: vf610: Fix to check for NULL pointer dereference

2019-03-18 Thread Aditya Pakki
of_match_device can return NULL if there is no matching device is found. The patch avoids a potential NULL pointer dereference by checking for the return value and passing the error upstream. Signed-off-by: Aditya Pakki --- drivers/mtd/nand/raw/vf610_nfc.c | 2 ++ 1 file changed, 2 insertions

[PATCH] mfd: mc13xxx: i2c/spi Fix to avoid NULL pointer dereference

2019-03-18 Thread Aditya Pakki
of_match_device can return NULL if no matching device is found. The patches avoids a scenario causing null pointer dereference. Signed-off-by: Aditya Pakki --- drivers/mfd/mc13xxx-i2c.c | 2 ++ drivers/mfd/mc13xxx-spi.c | 2 ++ 2 files changed, 4 insertions(+) diff --git a/drivers/mfd/mc13xxx

[PATCH] firmware: arm_scmi: Fix to check return value of of_match_device

2019-03-18 Thread Aditya Pakki
of_match_device can return NULL if no matching device is found. This patch checks and returns -ENODEV in such a scenario. Signed-off-by: Aditya Pakki --- drivers/firmware/arm_scmi/driver.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/firmware/arm_scmi/driver.c b/drivers

[PATCH] thunderbolt: Fix to check for kmemdup failure

2019-03-18 Thread Aditya Pakki
Memory allocated via kmemdup might fail and return a NULL pointer. This patch adds a check on the return value of kmemdup and passes the error upstream. Signed-off-by: Aditya Pakki --- drivers/thunderbolt/switch.c | 15 +++ 1 file changed, 11 insertions(+), 4 deletions(-) diff

[PATCH] staging: rtl8188eu: Fix potential NULL pointer dereference

2019-03-13 Thread Aditya Pakki
hwxmits is allocated via kcalloc and not checked for failure before its dereference. The patch fixes this problem similar to rtl8723bs. Signed-off-by: Aditya Pakki --- drivers/staging/rtl8188eu/core/rtw_xmit.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/staging/rtl8188eu

[PATCH] spi : spi-topcliff-pch: Fix to handle empty DMA buffers

2019-03-13 Thread Aditya Pakki
pch_alloc_dma_buf allocated tx, rx DMA buffers which can fail. Further, these buffers are used without a check. The patch checks for these failures and sends the error upstream. Signed-off-by: Aditya Pakki --- drivers/spi/spi-topcliff-pch.c | 15 +-- 1 file changed, 13 insertions

[PATCH] staging: rtlwifi: Fix potential NULL pointer dereference

2019-03-13 Thread Aditya Pakki
skb allocated via dev_alloc_skb can fail and return a NULL pointer. This patch avoids such a scenario and returns, consistent with other invocations. Signed-off-by: Aditya Pakki --- drivers/staging/rtlwifi/rtl8822be/fw.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/staging

[PATCH] staging: rtlwifi: Fix potential NULL pointer dereference

2019-03-13 Thread Aditya Pakki
phydm.internal is allocated using kzalloc which is used multiple times without a check for NULL pointer. This patch avoids such a scenario. Signed-off-by: Aditya Pakki --- drivers/staging/rtlwifi/phydm/rtl_phydm.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/staging/rtlwifi

[PATCH] pinctrl: axp209: Fix NULL pointer dereference after allocation

2019-03-12 Thread Aditya Pakki
axp20x_build_funcs_groups allocates groups via devm_kcalloc and tries to dereference without checking for NULL. This patch avoids such a scenario. Signed-off-by: Aditya Pakki --- drivers/pinctrl/pinctrl-axp209.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/pinctrl/pinctrl

[PATCH] pinctrl: baytrail: Fix potential NULL pointer dereference

2019-03-12 Thread Aditya Pakki
saved-context in byt_gpio_probe is allocated via devm_kcalloc and is used without checking for NULL in later functions. This patch avoids such a scenario. Signed-off-by: Aditya Pakki --- drivers/pinctrl/intel/pinctrl-baytrail.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers

[PATCH] net: ethernet: Fix phy_set_max_speed by checking for NULL

2019-03-04 Thread Aditya Pakki
phy_device can be a NULL pointer which is further dereferenced downstream in phy_set_max_speed. This patch avoids such a scenario. Signed-off-by: Aditya Pakki --- drivers/net/ethernet/broadcom/genet/bcmmii.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/ethernet/broadcom

[PATCH] ata: dwc_460ex: Avoid potential NULL pointer dereference

2019-03-04 Thread Aditya Pakki
dma_async_tx_descriptor can contain a NULL variable and using it in dmaengine_submit without checking can crash the process. This patch avoids such a scenario. Signed-off-by: Aditya Pakki --- drivers/ata/sata_dwc_460ex.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git

[PATCH] ALSA: usx2y: Fix potential NULL pointer dereference

2019-03-04 Thread Aditya Pakki
usb_alloc_urb can fail due to kmalloc failure and push the error upstream. Further this can cause a NULL pointer dereference in init_pipe_urbs. This patch avoids such a scenario. Signed-off-by: Aditya Pakki --- sound/usb/usx2y/usb_stream.c | 5 + 1 file changed, 5 insertions(+) diff

[PATCH] md: Fix failed allocation of md_register_thread

2019-03-04 Thread Aditya Pakki
mddev->sync_thread can be set to NULL on kzalloc failure downstream. The patch checks for such a scenario and frees allocated resources. Signed-off-by: Aditya Pakki --- drivers/md/raid10.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/md/raid10.c b/drivers/md/raid10.c in

[PATCH] mfd: sm501: Fix potential NULL pointer dereference

2019-03-02 Thread Aditya Pakki
lookup variable on failure of allocating memory via devm_kzalloc can cause a NULL pointer dereference. This patch avoids such a scenario. Signed-off-by: Aditya Pakki --- drivers/mfd/sm501.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c index

[PATCH] isdn: mISDN: Fix potential NULL pointer dereference of kzalloc

2019-03-02 Thread Aditya Pakki
Allocating memory via kzalloc for phi may fail and causes a NULL pointer dereference. This patch avoids such a scenario. Signed-off-by: Aditya Pakki --- drivers/isdn/hardware/mISDN/hfcsusb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/isdn/hardware/mISDN/hfcsusb.c b/drivers

[PATCH] x86: uv: Fix potential NULL pointer dereference of kmalloc_node

2019-03-02 Thread Aditya Pakki
kmalloc_node might fail to allocate memory for thp field. This fix attempts to avoid a potential NULL pointer dereference. Signed-off-by: Aditya Pakki --- arch/x86/platform/uv/tlb_uv.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/x86/platform/uv/tlb_uv.c b/arch/x86/platform/uv

[PATCH] omapfb: Fix potential NULL pointer dereference in kmalloc

2019-03-02 Thread Aditya Pakki
Memory allocated, using kmalloc, for new_compat may fail. This patch checks for such an error and prevents potential NULL pointer dereference. Signed-off-by: Aditya Pakki --- drivers/video/fbdev/omap2/omapfb/dss/omapdss-boot-init.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers

[PATCH] rsi: Fix NULL pointer dereference in kmalloc

2019-03-02 Thread Aditya Pakki
kmalloc can fail in rsi_register_rates_channels but memcpy still attempts to write to channels. The patch checks and avoids such a situation. Signed-off-by: Aditya Pakki --- drivers/net/wireless/rsi/rsi_91x_mac80211.c | 10 ++ 1 file changed, 10 insertions(+) diff --git a/drivers/net

[PATCH] [v3] staging: rtl8723bs: Clean up dead code

2019-01-07 Thread Aditya Pakki
ever, maintainers identified the patch fixing the issue is not required as function rts_wps_start() is dead code and can be removed. Signed-off-by: Aditya Pakki --- .../staging/rtl8723bs/os_dep/ioctl_linux.c| 34 +-- 1 file changed, 1 insertion(+), 33 deletions(-) diff --git a/dri

[PATCH] [v2] Input: touchscreen: Fix a missing check on regmap_bulk_read

2019-01-06 Thread Aditya Pakki
regmap_bulk_read() can return a non zero value on failure. The fix checks if the function call succeeded before calling mod_timer. The issue was identified by a static analysis tool. Signed-off-by: Aditya Pakki --- drivers/input/touchscreen/ad7879.c | 11 +++ 1 file changed, 7

[PATCH] [v2] hwrng: core: Fix missing check during driver release

2019-01-06 Thread Aditya Pakki
devres_release can return -ENOENT if the device is not freed. The fix throws a warning consistent with other invocations. Signed-off-by: Aditya Pakki --- drivers/char/hw_random/core.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/char/hw_random/core.c b/drivers

[PATCH] [v2] ALSA: isa: fix a missing check of snd_ctl_add

2019-01-06 Thread Aditya Pakki
snd_ctl_add() could fail, so let's check its return value and return its error code upstream upon failure. Signed-off-by: Aditya Pakki --- sound/isa/sb/sb16_main.c | 10 +++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/sound/isa/sb/sb16_main.c b/sound/isa/sb/sb16_main.c

[PATCH] [v2] ALSA: line6: fix check on snd_card_register

2019-01-06 Thread Aditya Pakki
The fix checks if snd_card_register() fails, and if so logs the error via dev_err() consistent with other patches. Signed-off-by: Aditya Pakki --- sound/usb/line6/pod.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/sound/usb/line6/pod.c b/sound/usb/line6/pod.c index

[PATCH] [v2] ALSA: ice1712: fix a missing check of snd_i2c_sendbytes

2019-01-06 Thread Aditya Pakki
snd_i2c_sendbytes could fail. The fix checks its return value: if it fails, issues an error message and returns with its error code. Signed-off-by: Aditya Pakki --- sound/pci/ice1712/ews.c | 7 ++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/sound/pci/ice1712/ews.c b/sound

[PATCH] v2 staging: rtl8723bs: Clean up dead code

2019-01-06 Thread Aditya Pakki
rtw_wps_start() is part of dead code due to CONFIG_INTEL_WIDI. The fix removes the deadcode and replaces the function with NULL in rtw_private_handler. Identified as part of copy_from_user bug. Signed-off-by: Aditya Pakki --- .../staging/rtl8723bs/os_dep/ioctl_linux.c| 34

[PATCH] v2 pm: clk: fix a missing check of clk_prepare

2019-01-05 Thread Aditya Pakki
clk_prepare() could fail, so let's check its status, and if it fails, issue an error message and change the clock_entry_status to PCE_STATUS_ERROR Signed-off-by: Aditya Pakki --- drivers/base/power/clock_ops.c | 13 + 1 file changed, 9 insertions(+), 4 deletions(-) diff --git

[PATCH] v2 bakclight: fix missing checks in ambient_light_zone_store

2019-01-05 Thread Aditya Pakki
In adp8870_bl_ambient_light_zone_store, set, clear, and write can return an error but are not checked. The fix adds a check for these cases and returns -1 to match the return type (ssize_t). Signed-off-by: Aditya Pakki --- drivers/video/backlight/adp8870_bl.c | 16 +--- 1 file

[PATCH] [v2]RDMA: add checks for the status of nla_put in ib_nl_send_msg

2019-01-05 Thread Aditya Pakki
The fix inserts multiple checks for nla_put, and changes the return type of ib_nl_set_path_rec_attrs() from void to int Signed-off-by: Aditya Pakki --- drivers/infiniband/core/sa_query.c | 56 -- 1 file changed, 38 insertions(+), 18 deletions(-) diff --git a/drivers

[PATCH] [V2] infiniband: fix a missing check of nla_put

2019-01-05 Thread Aditya Pakki
nla_put() may fail. The fix adds a check for its return value, and returns -EMSGSIZE if it fails, post canceling netlink msg. Signed-off-by: Aditya Pakki --- drivers/infiniband/core/addr.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/infiniband/core/addr.c b

[PATCH] [V2] usb: chipidea: add a check for the availability of next child

2019-01-05 Thread Aditya Pakki
of_get_next_available_child returns NULL when no child nodes are found. The fix checks its return value instead of assuming a child is found. Signed-off-by: Aditya Pakki --- drivers/usb/chipidea/ci_hdrc_msm.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/usb/chipidea

  1   2   >