The "wep" buffer is not initialized. To avoid memory disclosures,
the fix initializes it, as peer functions like rtllib_ccmp_set_key
do.
Signed-off-by: Kangjie Lu
---
drivers/staging/rtl8192e/rtllib_crypt_wep.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/stagin
"f->fmt.sdr.reserved" is uninitialized. As other peer drivers
like msi2500 and airspy do, the fix initializes it to avoid
memory disclosures.
Signed-off-by: Kangjie Lu
---
drivers/media/platform/rcar_drif.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/media/platfor
The "key" is not scrubbed. As what peer modules do, the fixes zeros
out the key buffer.
Signed-off-by: Kangjie Lu
---
net/wireless/lib80211_crypt_wep.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/net/wireless/lib80211_crypt_wep.c
b/net/wireless/lib80211_crypt_wep.c
index da
Commit-ID: 766460852cfaeca4042e5f3aeb9616b3689147bc
Gitweb: https://git.kernel.org/tip/766460852cfaeca4042e5f3aeb9616b3689147bc
Author: Kangjie Lu
AuthorDate: Mon, 25 Mar 2019 15:29:22 -0500
Committer: Borislav Petkov
CommitDate: Tue, 26 Mar 2019 17:01:30 +0100
x86/platform/uv: Fix
If __get_free_pages() fails, the patch returns -ENOMEM to avoid
NULL pointer dereference.
Signed-off-by: Kangjie Lu
---
v3: remove "unlikely", as suggested by Bjorn Helgaas.
v2: caller is redefined to accept the error code, as suggested by
Steven Price
---
drivers/pci/controller/pci
In case __get_free_pages fail, the fix returns -ENOMEMto avoid
NULL pointer dereference.
Signed-off-by: Kangjie Lu
Reviewed-by: Steven Price
---
v2: caller is redefined to accept the error code, as suggested by
Steven Price
---
drivers/pci/controller/pcie-xilinx.c | 12 ++--
1 file
In case devm_kzalloc fails, the patch returns -ENOMEM to avoid
potential NULL pointer dereference.
Also add a check for rt5663_parse_dp to pass the error code
upstream
Signed-off-by: Kangjie Lu
Reviewed-by: Mukesh Ojha
---
v2: pass error code upstream in the caller as suggested by
Mukesh Ojha
().
Therefore, the patch conservatively checks the return value and
returns -EINVAL when it indeed failed.
Signed-off-by: Kangjie Lu
Reviewed-by: Steven Price
---
drivers/firmware/arm_scmi/driver.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/firmware/arm_scmi/driver.c
b
In case kcalloc fails, the patch return an error to avoid
potential NULL pointer dereference.
Signed-off-by: Kangjie Lu
---
v2: reuse existing error path as suggested by
Borislav Petkov
---
arch/x86/platform/uv/tlb_uv.c | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git
No check is enforced for the return value of kzalloc,
which may lead to NULL-pointer dereference.
The patch fixes this issue.
Signed-off-by: Kangjie Lu
Reviewed-by: Mukesh Ojha
---
V2: no overflow issue, as pointed out by
Mika Westerberg
---
drivers/thunderbolt/property.c | 7 ++-
1
regmap_update_bits could fail. The fix checks its status and if
it fails, returns its error code upstream.
Signed-off-by: Kangjie Lu
---
sound/soc/codecs/cs35l34.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/soc/codecs/cs35l34.c b/sound/soc/codecs/cs35l34.c
index 5063c05afa27
In case devm_kzalloc fails, the patch returns -ENOMEM to avoid
potential NULL pointer dereference.
Signed-off-by: Kangjie Lu
---
sound/soc/codecs/rt5663.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/soc/codecs/rt5663.c b/sound/soc/codecs/rt5663.c
index da6647015708..909ab99a1995
In case devm_kzalloc, the patch returns ENOMEM to avoid potential
NULL pointer dereference.
Signed-off-by: Kangjie Lu
---
drivers/gpio/gpio-aspeed.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpio/gpio-aspeed.c b/drivers/gpio/gpio-aspeed.c
index 854bce4fb9e7..217507002dbc
In case kcalloc fails, the patch return an error to avoid
potential NULL pointer dereference.
Signed-off-by: Kangjie Lu
---
arch/x86/platform/uv/tlb_uv.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/arch/x86/platform/uv/tlb_uv.c b/arch/x86/platform/uv/tlb_uv.c
index 2c53b0f19329
First, no memory is allocated for "property->value.text"; the
following strcpy will lead to a buffer overflow.
Second, no check is enforced for the return value of kzalloc,
which may lead to NULL-pointer dereference.
The patch fixes the two issues.
Signed-off-by: Kangjie Lu
When kzalloc fails, "platform_state->inited = 1" is a NULL pointer
dereference. The fix returns VCHIQ_ERROR in case it failed to
avoid NULL pointer dereference.
Signed-off-by: Kangjie Lu
---
.../staging/vc04_services/interface/vchiq_arm/vchiq_2835_arm.c | 2 ++
1 file changed,
It is invalid when "buf_len" is not aligned with "period_len".
The fix adds a check for the alignment.
Signed-off-by: Kangjie Lu
---
drivers/dma/ti/omap-dma.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/dma/ti/omap-dma.c b/drivers/dma/ti/omap-dma.
As other functions in this module do, edev should be checked to
ensure that it is not NULL.
The fix inserts such as check to avoid potential NULL pointer
dereference.
Signed-off-by: Kangjie Lu
---
drivers/firmware/edd.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/firmware
Hi Lee Jones,
Can you review this patch?
Thanks.
> On Mar 9, 2019, at 2:04 AM, Kangjie Lu wrote:
>
> In case devm_kzalloc fails, the fix does NULL check and returns
> -ENOMEM upon failure so as to avoid NULL pointer dereference.
>
> Signed-off-by: Kangjie Lu
> ---
>
Hi Maxim,
Can you review this patch?
Thanks,
> On Mar 9, 2019, at 1:59 AM, Kangjie Lu wrote:
>
> In case alloc_ordered_workqueue fails, the fix returns ENOMEM to
> avoid potential NULL pointer dereference.
>
> Signed-off-by: Kangjie Lu
> ---
> drivers/memstick/core/
In case of_device_get_match_data fails to find the matched data,
returns -ENODEV
Signed-off-by: Kangjie Lu
---
drivers/input/misc/pm8xxx-vibrator.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/input/misc/pm8xxx-vibrator.c
b/drivers/input/misc/pm8xxx-vibrator.c
index
> On Mar 8, 2019, at 11:19 PM, Kangjie Lu wrote:
>
> get_skb may fail and return NULL. The fix returns "ENOMEM"
> when it fails to avoid NULL dereference.
>
> Signed-off-by: Kangjie Lu
> ---
> drivers/infiniband/hw/cxgb4/cm.c | 3 +++
> 1 file cha
> On Mar 8, 2019, at 10:02 PM, Kangjie Lu wrote:
>
> idr_find may return NULL, so check its return value and return an
> error code.
Can someone review this patch? Thanks.
>
> Signed-off-by: Kangjie Lu
> ---
> drivers/firmware/arm_scmi/driver.c | 2 ++
> 1
Commit-ID: 534c89c22e26b183d838294f0937ee092c82ad3a
Gitweb: https://git.kernel.org/tip/534c89c22e26b183d838294f0937ee092c82ad3a
Author: Kangjie Lu
AuthorDate: Thu, 14 Mar 2019 00:46:51 -0500
Committer: Thomas Gleixner
CommitDate: Thu, 21 Mar 2019 12:24:39 +0100
x86/hyperv: Prevent
When regmap_read fails, it doesn't make sense to use the read
value "val" because it can be uninitialized.
The fix returns if regmap_read fails.
Signed-off-by: Kangjie Lu
---
drivers/extcon/extcon-axp288.c | 4
1 file changed, 4 insertions(+)
diff --git a/drivers/extcon/extcon-
In case create_workqueue fails, the fix releases resources and
returns -ENOMEM to avoid NULL pointer dereference.
Signed-off-by: Kangjie Lu
---
drivers/rapidio/rio_cm.c | 8
1 file changed, 8 insertions(+)
diff --git a/drivers/rapidio/rio_cm.c b/drivers/rapidio/rio_cm.c
index
When regmap_read fails, it doesn't make sense to use the read
value "val" because it can be uninitialized.
The fix returns if regmap_read fails.
Signed-off-by: Kangjie Lu
---
drivers/extcon/extcon-axp288.c | 4
1 file changed, 4 insertions(+)
diff --git a/drivers/extcon/extcon-
devm_regmap_init_i2c may fail and return NULL. The fix returns
the error when it fails.
Signed-off-by: Kangjie Lu
---
V2: fix the two together
---
drivers/iio/magnetometer/hmc5843_i2c.c | 7 ++-
drivers/iio/magnetometer/hmc5843_spi.c | 7 ++-
2 files changed, 12 insertions(+), 2
securityfs_create_file may fail. The fix checks its status and
returns the error code upstream if it fails.
Signed-off-by: Kangjie Lu
---
Return the exact error code upstream.
---
security/inode.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/security/inode.c b/security/inode.c
In case dmaengine_prep_dma_cyclic fails, the fix returns a proper
error code to avoid NULL pointer dereference.
Signed-off-by: Kangjie Lu
Fixes: 34df42f59a60 ("serial: at91: add rx dma support")
---
V2: simplified the patch as suggested by
Richard Genoud
---
drivers/tty/serial/atme
If affs_bread fails, do not use ext_bh to avoid NULL pointer
dereference
Signed-off-by: Kangjie Lu
---
fs/affs/file.c | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/fs/affs/file.c b/fs/affs/file.c
index a85817f54483..29cbc8eda085 100644
--- a/fs/affs/file.c
+++ b/fs
Fixes: 34df42f59a60 ("serial: at91: add rx dma support")
In case dmaengine_prep_dma_cyclic fails, the fix returns a proper
error code to avoid NULL pointer dereference.
Signed-off-by: Kangjie Lu
---
V2: simplified the patch as suggested by
Richard Genoud
---
drivers/tty/serial/atme
Fixes: 34df42f59a60 ("serial: at91: add rx dma support")
In case dmaengine_prep_dma_cyclic fails, the fix returns a proper
error code to avoid NULL pointer dereference.
Signed-off-by: Kangjie Lu
---
V2: simplified the patch as suggested by
Richard Genoud
---
drivers/tty/serial/atme
ipw->attr_memory and ipw->common_memory are assigned with the
return value of ioremap. ioremap may fail, but no checks
are enforced. The fix inserts the checks to avoid potential
NULL pointer dereferences.
Signed-off-by: Kangjie Lu
Reviewed-by: David Sterba
---
V2: fix typos
---
drive
alloc_ordered_workqueue may fail and return NULL.
The fix captures the failure and handles it properly to avoid
potential NULL pointer dereferences.
Signed-off-by: Kangjie Lu
---
V2: add return value to capture the error code
---
drivers/infiniband/hw/i40iw/i40iw.h | 2 +-
drivers
In case platform_device_alloc fails, the fix returns an error
code to avoid the NULL pointer dereference.
Signed-off-by: Kangjie Lu
---
drivers/slimbus/qcom-ngd-ctrl.c | 4
1 file changed, 4 insertions(+)
diff --git a/drivers/slimbus/qcom-ngd-ctrl.c b/drivers/slimbus/qcom-ngd-ctrl.c
index
In case alloc_workqueue, the fix returns -ENOMEM to avoid
potential NULL pointer dereferences.
Signed-off-by: Kangjie Lu
---
drivers/pci/endpoint/functions/pci-epf-test.c | 4
1 file changed, 4 insertions(+)
diff --git a/drivers/pci/endpoint/functions/pci-epf-test.c
b/drivers/pci
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: Kangjie Lu
---
drivers/tty/serial/8250/8250_lpss.c | 13 -
1 file changed, 8 insertions(+), 5 deletions(-)
diff
securityfs_create_file may fail. The fix checks its status and
returns EFAULT upstream if it fails.
Signed-off-by: Kangjie Lu
---
security/inode.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/security/inode.c b/security/inode.c
index b7772a9b315e..11d9a6bc2161 100644
--- a/security
In case request_region fails, the fix returns an error code to
avoid NULL pointer dereference.
Signed-off-by: Kangjie Lu
---
sound/isa/sb/sb8.c | 4
1 file changed, 4 insertions(+)
diff --git a/sound/isa/sb/sb8.c b/sound/isa/sb/sb8.c
index aa2a83eb81a9..dc27a480c2d9 100644
--- a/sound/isa
In case ioremap_nocache fails, the fix releases chip and returns
an error code upstream to avoid NULL pointer dereference.
Signed-off-by: Kangjie Lu
---
sound/pci/echoaudio/echoaudio.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/sound/pci/echoaudio/echoaudio.c b/sound/pci/echoaudio
In case create_singlethread_workqueue fails, the fix returns
-ENOMEM to avoid potential NULL pointer dereference.
Signed-off-by: Kangjie Lu
---
sound/soc/codecs/cs43130.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/sound/soc/codecs/cs43130.c b/sound/soc/codecs/cs43130.c
index
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 a/sound/soc/codecs/rt5645.c b/sound/soc/codecs/rt5645.c
index
In case debugfs_create_u32 fails, the fix frees memory and returns
an error to notify callers.
Signed-off-by: Kangjie Lu
---
sound/soc/soc-pcm.c | 16 +++-
1 file changed, 11 insertions(+), 5 deletions(-)
diff --git a/sound/soc/soc-pcm.c b/sound/soc/soc-pcm.c
index 0d5ec68a1e50
If affs_bread fails, do not use ext_bh to avoid NULL pointer
dereference
Signed-off-by: Kangjie Lu
---
fs/affs/file.c | 10 +++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/fs/affs/file.c b/fs/affs/file.c
index a85817f54483..45b96faa40f1 100644
--- a/fs/affs/file.c
In case ioremap fails, the fix returns -ENOMEM to avoid NULL
pointer dereferences.
Multiple places use port.membase.
Signed-off-by: Kangjie Lu
---
drivers/tty/serial/mxs-auart.c | 4
1 file changed, 4 insertions(+)
diff --git a/drivers/tty/serial/mxs-auart.c b/drivers/tty/serial/mxs
In case dmaengine_prep_dma_cyclic fails, the fix return a proper
error code to avoid NULL pointer dereference.
Signed-off-by: Kangjie Lu
---
drivers/tty/serial/atmel_serial.c | 12 ++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/drivers/tty/serial/atmel_serial.c
b
ipw->attr_memory and ipw->common_memory are assigned with the
return value of ioremap. ioremap may fail, but not checks
are enforced. The fix insertss the checks.
Signed-off-by: Kangjie Lu
---
drivers/tty/ipwireless/main.c | 8
1 file changed, 8 insertions(+)
diff --git a/drive
kmemdup may fail and return NULL. The fix adds a check and returns
NULL in case it fails to avoid NULL pointer dereferecen.
Signed-off-by: Kangjie Lu
---
drivers/thunderbolt/property.c | 4
1 file changed, 4 insertions(+)
diff --git a/drivers/thunderbolt/property.c b/drivers/thunderbolt
ida_simple_get could fail. The fix inserts a check for its
return value.
Signed-off-by: Kangjie Lu
---
drivers/staging/greybus/audio_manager.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/staging/greybus/audio_manager.c
b/drivers/staging/greybus/audio_manager.c
index
In case dmaengine_prep_slave_sg fails, the fix returns to avoid
NULL pointer dereference.
Signed-off-by: Kangjie Lu
---
drivers/spi/spi-s3c64xx.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/spi/spi-s3c64xx.c b/drivers/spi/spi-s3c64xx.c
index 7b7151ec14c8..3a5f161ce558 100644
In case create_workqueue fails, the fix releases resources and
returns -ENOMEM to avoid NULL pointer dereference.
Signed-off-by: Kangjie Lu
---
drivers/rapidio/rio_cm.c | 8
1 file changed, 8 insertions(+)
diff --git a/drivers/rapidio/rio_cm.c b/drivers/rapidio/rio_cm.c
index
In case create_freezable_workqueue fails, the fix return -ENOMEM
to avoid a potential NULL pointer dereference.
Signed-off-by: Kangjie Lu
---
drivers/power/supply/charger-manager.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/power/supply/charger-manager.c
b/drivers/power
In case __get_free_pages fail, the fix returns to avoid NULL
pointer dereference.
Signed-off-by: Kangjie Lu
---
drivers/pci/controller/pcie-xilinx.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/pci/controller/pcie-xilinx.c
b/drivers/pci/controller/pcie-xilinx.c
index
In case __get_free_pages fails and returns NULL, the fix returns
-ENOMEM and releases resources to avoid NULL pointer dereference.
Signed-off-by: Kangjie Lu
---
drivers/pci/controller/pci-tegra.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/drivers/pci/controller/pci-tegra.c
b
In case alloc_page, the fix returns -ENOMEM to avoid the potential
NULL pointer dereference.
Signed-off-by: Kangjie Lu
---
arch/x86/hyperv/hv_init.c | 6 +-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/arch/x86/hyperv/hv_init.c b/arch/x86/hyperv/hv_init.c
index 7abb09e2eeb8
alloc_ordered_workqueue may fail and return NULL.
The fix captures the failure and handles it properly to avoid
potential NULL pointer dereferences.
Signed-off-by: Kangjie Lu
---
V2: add return value to capture the error code
drivers/infiniband/hw/i40iw/i40iw.h | 2 +-
drivers/infiniband
create_singlethread_workqueue may fail and return NULL. The fix
checks if it is NULL to avoid NULL pointer dereference.
Also, the fix moves the call of create_singlethread_workqueue
earlier to avoid resource-release issues.
--
V3: do not introduce memory leaks.
Signed-off-by: Kangjie Lu
In case kzalloc fails, the fix releases resources and returns
-ENOMEM to avoid the NULL pointer dereference.
Signed-off-by: Kangjie Lu
---
drivers/thunderbolt/property.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/drivers/thunderbolt/property.c b/drivers/thunderbolt/property.c
In case __get_free_pages fails, the fix releases resources and
return -ENOMEM to avoid NULL pointer dereferences.
Also, the fix frees pages when video_register_device fails to
avoid a memory leak.
Signed-off-by: Kangjie Lu
---
drivers/media/platform/rockchip/rga/rga.c | 15 ++-
1
create_singlethread_workqueue may fail and return NULL. The fix
checks if it is NULL to avoid NULL pointer dereference.
Also, the fix moves the call of create_singlethread_workqueue
earlier to avoid resource-release issues.
Signed-off-by: Kangjie Lu
---
drivers/hid/hid-logitech-hidpp.c | 8
> On Mar 11, 2019, at 6:19 PM, David Miller wrote:
>
> From: Kangjie Lu
> Date: Mon, 11 Mar 2019 02:10:21 -0500
>
>> adapter->control_wq = alloc_workqueue(DRV_NAME "/control",
>>WQ_MEM_RECLA
In case kmemdup fails, the fix sets conn_info->req_ie_len to zero
to avoid buffer overflows.
Signed-off-by: Kangjie Lu
---
drivers/net/wireless/broadcom/brcm80211/brcmfmac/cfg80211.c | 4
1 file changed, 4 insertions(+)
diff --git a/drivers/net/wireless/broadcom/brcm80211/brcmf
In case spi_sync_locked fails, the fix reports the error and
returns the error code upstream.
Signed-off-by: Kangjie Lu
---
drivers/mmc/host/mmc_spi.c | 4
1 file changed, 4 insertions(+)
diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c
index 1b1498805972..a3533935e282
In case octeon_alloc_soft_command fails, the fix reports the
error and returns to avoid NULL pointer dereference.
Signed-off-by: Kangjie Lu
---
drivers/net/ethernet/cavium/liquidio/lio_main.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/drivers/net/ethernet/cavium/liquidio
In case ioremap fails, the fix returns to avoid NULL pointer
dereferences.
Signed-off-by: Kangjie Lu
---
drivers/net/ethernet/8390/pcnet_cs.c | 8
1 file changed, 8 insertions(+)
diff --git a/drivers/net/ethernet/8390/pcnet_cs.c
b/drivers/net/ethernet/8390/pcnet_cs.c
index
Both lan9303_phy_write and regmap_write may fail. The fix adds
the error handling to print error messages upon failure.
Signed-off-by: Kangjie Lu
---
drivers/net/dsa/lan9303-core.c | 6 ++
1 file changed, 6 insertions(+)
diff --git a/drivers/net/dsa/lan9303-core.c b/drivers/net/dsa/lan9303
In case alloc_workqueue fails to allocate the work queue and
returns NULL, the fix releases the resources and returns
-ENOMEM.
Signed-off-by: Kangjie Lu
---
drivers/net/can/spi/mcp251x.c | 8
1 file changed, 8 insertions(+)
diff --git a/drivers/net/can/spi/mcp251x.c b/drivers/net/can
In case spi_sync_locked fails, the fix reports the error and
returns the error code upstream.
Signed-off-by: Kangjie Lu
---
drivers/mmc/host/mmc_spi.c | 4
1 file changed, 4 insertions(+)
diff --git a/drivers/mmc/host/mmc_spi.c b/drivers/mmc/host/mmc_spi.c
index 1b1498805972..32fea585262b
In case devm_regmap_init_spi fails and returns NULL, the fix
returns an error to avoid NULL pointer dereference
Signed-off-by: Kangjie Lu
---
drivers/iio/magnetometer/hmc5843_spi.c | 8 +++-
1 file changed, 7 insertions(+), 1 deletion(-)
diff --git a/drivers/iio/magnetometer/hmc5843_spi.c
In case devm_kzalloc fails, the fix does NULL check and returns
-ENOMEM upon failure so as to avoid NULL pointer dereference.
Signed-off-by: Kangjie Lu
---
drivers/mfd/sm501.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/mfd/sm501.c b/drivers/mfd/sm501.c
index a530972c5a7e
In case alloc_ordered_workqueue fails, the fix returns ENOMEM to
avoid potential NULL pointer dereference.
Signed-off-by: Kangjie Lu
---
drivers/memstick/core/ms_block.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/drivers/memstick/core/ms_block.c b/drivers/memstick/core/ms_block.c
In case usb_alloc_coherent fails, the fix returns -ENOMEM to
avoid a potential NULL pointer dereference.
Signed-off-by: Kangjie Lu
---
drivers/media/usb/usbvision/usbvision-core.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/media/usb/usbvision/usbvision-core.c
b/drivers
devm_kcalloc may fail and return a null pointer. The fix returns
-ENOMEM upon failures to avoid null pointer dereferences.
Signed-off-by: Kangjie Lu
---
drivers/media/platform/video-mux.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/drivers/media/platform/video-mux.c
b/drivers
In case of_match_device cannot find a match, the check returns
-EINVAL to avoid a potential NULL pointer dereference
Signed-off-by: Kangjie Lu
---
drivers/media/platform/renesas-ceu.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/media/platform/renesas-ceu.c
b
In case of_match_node cannot find a match, the fix returns
-EINVAL to avoid NULL pointer dereference.
Signed-off-by: Kangjie Lu
---
drivers/media/platform/rcar-vin/rcar-core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/media/platform/rcar-vin/rcar-core.c
b/drivers/media
In case ioremap fails, the fix returns -ENOMEM to avoid NULL
pointer dereference.
Signed-off-by: Kangjie Lu
---
drivers/media/platform/davinci/vpss.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/media/platform/davinci/vpss.c
b/drivers/media/platform/davinci/vpss.c
index
In case __get_free_pages fails, return -ENOMEM to avoid NULL
pointer dereferences.
Signed-off-by: Kangjie Lu
---
drivers/media/platform/rockchip/rga/rga.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/drivers/media/platform/rockchip/rga/rga.c
b/drivers/media/platform/rockchip/rga
Conservatively check return value of STV090x_WRITE_DEMOD in case
it fails.
Signed-off-by: Kangjie Lu
---
drivers/media/dvb-frontends/stv090x.c | 19 +--
1 file changed, 13 insertions(+), 6 deletions(-)
diff --git a/drivers/media/dvb-frontends/stv090x.c
b/drivers/media/dvb
In case of_match_device cannot find a match, the fixes returns
-EINVAL to avoid NULL pointer dereference.
Signed-off-by: Kangjie Lu
---
drivers/leds/leds-pca9532.c | 8 ++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/drivers/leds/leds-pca9532.c b/drivers/leds/leds-pca9532
In case ioremap fails, the fix returns -ENOMEM to avoid NULL
pointer dereference.
Signed-off-by: Kangjie Lu
---
drivers/isdn/hardware/mISDN/mISDNinfineon.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/isdn/hardware/mISDN/mISDNinfineon.c
b/drivers/isdn
In case ioremap fails, the fix reports an error and returns.
Signed-off-by: Kangjie Lu
---
drivers/isdn/hardware/mISDN/hfcpci.c | 5 +
1 file changed, 5 insertions(+)
diff --git a/drivers/isdn/hardware/mISDN/hfcpci.c
b/drivers/isdn/hardware/mISDN/hfcpci.c
index ebb3fa2e1d00..b400d6528a56
In case of_device_get_match_data fails to find the matched data,
returns -ENODEV
Signed-off-by: Kangjie Lu
---
drivers/input/misc/pm8xxx-vibrator.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/input/misc/pm8xxx-vibrator.c
b/drivers/input/misc/pm8xxx-vibrator.c
index
alloc_ordered_workqueue may fail and return NULL. Let's check
its return value to ensure it is not NULL so as to avoid
potential NULL pointer dereferences.
Signed-off-by: Kangjie Lu
---
drivers/infiniband/hw/i40iw/i40iw_cm.c | 12
1 file changed, 12 insertions(+)
diff --git
get_skb may fail and return NULL. The fix returns "ENOMEM"
when it fails to avoid NULL dereference.
Signed-off-by: Kangjie Lu
---
drivers/infiniband/hw/cxgb4/cm.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/infiniband/hw/cxgb4/cm.c b/drivers/infiniband/hw/cxgb4/
devm_regmap_init_i2c may fail and return NULL. The fix returns
the error when it fails.
Signed-off-by: Kangjie Lu
---
drivers/iio/magnetometer/hmc5843_i2c.c | 7 ++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/drivers/iio/magnetometer/hmc5843_i2c.c
b/drivers/iio
devm_iio_trigger_alloc may fail and return NULL. The fix returns
ENOMEM when it fails.
Signed-off-by: Kangjie Lu
---
drivers/iio/adc/mxs-lradc-adc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/iio/adc/mxs-lradc-adc.c b/drivers/iio/adc/mxs-lradc-adc.c
index c627513d9f0f
of_match_device may return NULL when it fails, and in this case,
there will be a NULL pointer dereference. The fix returns
EINVAL when of_match_device returns NULL.
Signed-off-by: Kangjie Lu
---
drivers/iio/adc/max9611.c | 7 +--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git
create_singlethread_workqueue may fail and return NULL. The fix
checks if it is NULL to avoid NULL pointer dereference.
Signed-off-by: Kangjie Lu
---
drivers/hid/hid-logitech-hidpp.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/hid/hid-logitech-hidpp.c b/drivers/hid/hid
alloc_ordered_workqueue may fail and return NULL.
The fix returns ENOMEM when it fails to avoid potential NULL
pointer dereference.
Signed-off-by: Kangjie Lu
---
drivers/gpu/drm/vkms/vkms_crtc.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/vkms/vkms_crtc.c b/drivers/gpu
alloc_workqueue may fail. The fix checks its status. We probably
need to add a return value for radeon_crtc_init, so that we can
pass an error code upstream.
Signed-off-by: Kangjie Lu
---
drivers/gpu/drm/radeon/radeon_display.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu
If the allocation fails, return false to avoid potential
NULL pointer dereference
Signed-off-by: Kangjie Lu
---
drivers/gpu/drm/i915/i915_gpu_error.c | 5 -
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/i915/i915_gpu_error.c
b/drivers/gpu/drm/i915
kmemdup could fail and return NULL. To avoid null pointer
dereference, the fix checkes its return value and returns
ENOMEM upon failures.
Signed-off-by: Kangjie Lu
---
drivers/gpu/drm/amd/amdkfd/kfd_crat.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdkfd
ida_simple_get may fail and return a negative error number.
The fix checks its return value; if it fails, go to err_destroy.
Signed-off-by: Kangjie Lu
---
drivers/gpio/gpio-exar.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpio/gpio-exar.c b/drivers/gpio/gpio-exar.c
index
idr_find may return NULL, so check its return value and return an
error code.
Signed-off-by: Kangjie Lu
---
drivers/firmware/arm_scmi/driver.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/firmware/arm_scmi/driver.c
b/drivers/firmware/arm_scmi/driver.c
index 8f952f2f1a29
Check if ioremap fails, and if so, return AE_ERROR.
Signed-off-by: Kangjie Lu
---
drivers/char/hpet.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/char/hpet.c b/drivers/char/hpet.c
index d0ad85900b79..3a1e6b3ccd10 100644
--- a/drivers/char/hpet.c
+++ b/drivers/char/hpet.c
If ixgbevf_write_msg_read_ack fails, return its error code upstream
Signed-off-by: Kangjie Lu
---
drivers/net/ethernet/intel/ixgbevf/vf.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/net/ethernet/intel/ixgbevf/vf.c
b/drivers/net/ethernet/intel/ixgbevf/vf.c
On 3/2/19 3:26 PM, Gustavo A. R. Silva wrote:
On 3/2/19 3:20 PM, Aditya Pakki wrote:
Allocating memory via kzalloc for phi may fail and causes a
NULL pointer dereference. This patch avoids such a scenario.
Was this detected by Coccinelle?
It was detected by an LLVM-based static analyzer
Commit-ID: 120e4e76857ddbc9268e1aa3f9de61a498e84618
Gitweb: https://git.kernel.org/tip/120e4e76857ddbc9268e1aa3f9de61a498e84618
Author: Kangjie Lu
AuthorDate: Wed, 9 Jan 2019 01:45:24 -0600
Committer: Ingo Molnar
CommitDate: Mon, 21 Jan 2019 11:26:17 +0100
sched/core: Fix a potential
When match_int fails, "arg" is left uninitialized and may contain random
value, thus should not be used.
The fix checks if match_int fails, and if so, returns its error code.
Signed-off-by: Kangjie Lu
---
drivers/target/target_core_rd.c | 15 +--
1 file changed, 13 insert
1 - 100 of 242 matches
Mail list logo