Once we have called device_initialize(), we should
use put_device() to give up the reference on error,
just like what we have done on failure of device_add().
Signed-off-by: Dinghao Liu
---
block/partitions/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/block
> On 1/15/21 11:34 PM, Dinghao Liu wrote:
> > Once we have called device_initialize(), we should
> > use put_device() to give up the reference on error,
> > just like what we have done on failure of device_add().
> >
> > Signed-off-by: Dinghao Liu
> Please cons
> On Mon, 28 Dec 2020 16:14:17 -0500 Konstantin Ryabitsev wrote:
> > On Mon, Dec 28, 2020 at 01:05:26PM -0800, Florian Fainelli wrote:
> > > On 12/28/2020 12:23 PM, Konstantin Ryabitsev wrote:
> > > > On Thu, Dec 24, 2020 at 01:57:40PM -0800, Florian Fainelli wrote:
> > > Konstantin,
> On Wed, 6 Jan 2021 18:56:23 +0800 (GMT+08:00) dinghao@zju.edu.cn
> wrote:
> > > I used this one for a test:
> > >
> > > https://patchwork.kernel.org/project/netdevbpf/patch/1609312994-121032-1-git-send-email-abaci-bug...@linux.alibaba.com/
> > >
> > > I'm not getting the Fixes tag when I
Once we have called device_initialize(), we should use put_device() to
give up the reference on error, just like what we have done on failure
of device_add().
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Refine commit message.
---
block/partitions/core.c | 2 +-
1 file changed, 1 insertion
Once we have called device_initialize(), we should use put_device() to
give up the reference on error, just like what we have done on failure
of device_add().
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Refine commit message.
v3: - Add '[v3]' to the title.
---
block/partitions/core.c | 2
When devm_kcalloc() fails, we should execute device_unregister()
to unregister edev->dev from system.
Fixes: 046050f6e623e ("extcon: Update the prototype of
extcon_register_notifier() with enum extcon")
Signed-off-by: Dinghao Liu
---
drivers/extcon/extcon.c | 1 +
1 file changed
When power_up_sst() fails, stream needs to be freed
just like when try_module_get() fails. However, current
code is returning directly and ends up leaking memory.
Fixes: 0121327c1a68b ("ASoC: Intel: mfld-pcm: add control for powering up/down
dsp")
Signed-off-by: Dinghao Liu
---
sound
When restore_dsp_rettings() fails, chip should be freed
just like when init_hw() and request_irq() fails.
Fixes: 47b5d028fdce8 ("ALSA: Echoaudio - Add suspend support #2")
Signed-off-by: Dinghao Liu
---
sound/pci/echoaudio/echoaudio.c | 1 +
1 file changed, 1 insertion(+)
diff --g
When snd_pcm_hw_constraint_pow2() fails, dpcm should be freed
just like when hpi_instream_open() fails.
Fixes: 719f82d3987aa ("ALSA: Add support of AudioScience ASI boards")
Signed-off-by: Dinghao Liu
---
sound/pci/asihpi/asihpi.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletio
When kmalloc() on ticket fails, response should be freed
to prevent memleak.
Signed-off-by: Dinghao Liu
---
net/rxrpc/rxkad.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/rxrpc/rxkad.c b/net/rxrpc/rxkad.c
index 52a24d4ef5d8..e08130e5746b 100644
--- a/net/rxrpc
When pci_get_device_func() fails, we don't need to execute
pci_dev_put(). But mci should be freed to prevent memleak.
When pci_enable_device() fails, we don't need to disable
einj either.
Fixes: 52608ba205461 ("i5100_edac: probe for device 19 function 0")
Signed-off-by: Dinghao Liu
--
When amdgpu_display_modeset_create_props() fails, state and
state->context should be freed to prevent memleak. It's the
same when amdgpu_dm_audio_init() fails.
Signed-off-by: Dinghao Liu
---
drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 10 --
1 file changed, 8 insertions(+)
When kcalloc() on rx_rings fails, we should free tx_rings
and xdp_rings to prevent memleak. Similarly, when
ice_alloc_rx_bufs() fails, we should free xdp_rings.
Signed-off-by: Dinghao Liu
---
drivers/net/ethernet/intel/ice/ice_ethtool.c | 13 +++--
1 file changed, 11 insertions(+), 2
When ext4_journal_get_write_access() fails, we should release
n_group_desc, iloc.bh, dind and gdb_bh to prevent memleak.
It's the same when ext4_handle_dirty_super() fails, but we
don't need to release dind here because it has been released
before.
Signed-off-by: Dinghao Liu
---
fs/ext4
When dbBackSplit() fails, mp should be released to
prevent memleak. It's the same when dbJoin() fails.
Signed-off-by: Dinghao Liu
---
fs/jfs/jfs_dmap.c | 8 ++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/fs/jfs/jfs_dmap.c b/fs/jfs/jfs_dmap.c
index 7dfcab2a2da6
When lookup_root_entry() fails, ref should be freed
just like when insert_ref_entry() fails.
Signed-off-by: Dinghao Liu
---
fs/btrfs/ref-verify.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/btrfs/ref-verify.c b/fs/btrfs/ref-verify.c
index 7f03dbe5b609..712f5cfde404 100644
--- a/fs
When kmalloc() fails, cipher should be freed
just like when krb5_rc4_setup_seq_key() fails.
Fixes: e7afe6c1d486b ("sunrpc: fix 4 more call sites that were using stack
memory with a scatterlist")
Signed-off-by: Dinghao Liu
---
net/sunrpc/auth_gss/gss_krb5_seqnum.c | 6 --
1 file
When arch_setup_additional_pages() fails, interp_elf_ex may
not have been freed, which leads to memleak. It's the same
when create_elf_tables() fails.
Signed-off-by: Dinghao Liu
---
fs/binfmt_elf.c | 9 +++--
1 file changed, 7 insertions(+), 2 deletions(-)
diff --git a/fs/binfmt_elf.c b
> On Mon, 10 Aug 2020 08:39:55 +0200,
> Dinghao Liu wrote:
> >
> > When snd_pcm_hw_constraint_pow2() fails, dpcm should be freed
> > just like when hpi_instream_open() fails.
>
> It will be cleaned up via runtime->private_free call in the caller
> side (snd_p
> On Mon, 10 Aug 2020 08:14:58 +0200,
> Dinghao Liu wrote:
> >
> > When restore_dsp_rettings() fails, chip should be freed
> > just like when init_hw() and request_irq() fails.
> >
> > Fixes: 47b5d028fdce8 ("ALSA: Echoaudio - Add suspend su
Freeing chip on error may lead to an Oops at the next time
the system goes to resume. Fix this by removing all
snd_echo_free() calls on error.
Fixes: 47b5d028fdce8 ("ALSA: Echoaudio - Add suspend support #2")
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Remove snd_echo_free() ca
>
> On 8/9/20 3:56 AM, Dinghao Liu wrote:
> > When power_up_sst() fails, stream needs to be freed
> > just like when try_module_get() fails. However, current
> > code is returning directly and ends up leaking memory.
> >
> > Fixes: 0121327c1a68b ("ASoC:
When power_up_sst() fails, stream needs to be freed
just like when try_module_get() fails. However, current
code is returning directly and ends up leaking memory.
Fixes: 0121327c1a68b ("ASoC: Intel: mfld-pcm: add control for powering up/down
dsp")
Signed-off-by: Dinghao Liu
---
Chan
>
> > On 21 Aug 2020, at 10:10, Dinghao Liu wrote:
> >
> > When ida_alloc_max() fails, uverbs_dev should be freed
> > just like when init_srcu_struct() fails. It's the same
> > for the error paths after this call.
> >
> > Signed-off-by: Din
> Hi,
>
> On 21/08/2020 10:45, Dinghao Liu wrote:
> > pm_runtime_get_sync() increments the runtime PM usage counter
> > even when it returns an error code. However, users of
> > dsi_runtime_get(), a direct wrapper of pm_runtime_get_sync(),
> > assume that PM usage
the counter
balanced.
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Fix 5 additional similar cases in omapdrm.
---
drivers/gpu/drm/omapdrm/dss/dispc.c | 7 +--
drivers/gpu/drm/omapdrm/dss/dsi.c | 7 +--
drivers/gpu/drm/omapdrm/dss/dss.c | 7 +--
drivers/gpu/drm/omapdrm/dss/hdmi4.c
When we encounter invalid data width or address space,
entry should be freed just like what we've done in the
previous error paths.
Signed-off-by: Dinghao Liu
---
drivers/vme/bridges/vme_ca91cx42.c | 7 ---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/vme/bridges
The default error branch of a series of pdev_is_gen calls
should free ndev just like what we've done in these calls.
Signed-off-by: Dinghao Liu
---
drivers/ntb/hw/intel/ntb_hw_gen1.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ntb/hw/intel/ntb_hw_gen1.c
b
efore misc_register")
Signed-off-by: Dinghao Liu
---
drivers/watchdog/watchdog_dev.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/watchdog/watchdog_dev.c b/drivers/watchdog/watchdog_dev.c
index 6798addabd5a..8ee78e26feb1 100644
--- a/drivers/watchdog/watchdog_d
When down_killable() fails, skb_resp should be freed
just like when st95hf_spi_send() fails.
Signed-off-by: Dinghao Liu
---
drivers/nfc/st95hf/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c
index 9642971e89ce
When kmalloc() on buf fails, urb should be freed just like
when kmalloc() on dr fails.
Signed-off-by: Dinghao Liu
---
drivers/bluetooth/btusb.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/bluetooth/btusb.c b/drivers/bluetooth/btusb.c
index 8d2608ddfd08..f88968bcdd6a 100644
When clk_hw_register_fixed_rate_with_accuracy() fails,
clk_data should be freed. It's the same for the subsequent
error paths.
Signed-off-by: Dinghao Liu
---
drivers/rtc/rtc-sun6i.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/rtc/rtc-sun6i.c b/drivers/rtc
When devm_gpiod_get_optional() fails, bus should be
freed just like when of_mdiobus_register() fails.
Fixes: 1bddd96cba03d ("net: arc_emac: support the phy reset for emac driver")
Signed-off-by: Dinghao Liu
---
drivers/net/ethernet/arc/emac_mdio.c | 1 +
1 file changed, 1 insertio
When pm8001_tag_alloc() fails, task should be freed just
like what we've done in the subsequent error paths.
Signed-off-by: Dinghao Liu
---
drivers/scsi/pm8001/pm8001_sas.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/scsi/pm8001/pm8001_sas.c b/drivers/scsi/pm8001
When devm_regulator_register() fails, ec should be
freed just like when olpc_ec_cmd() fails.
Fixes: 231c0c216172a ("Platform: OLPC: Add a regulator for the DCON")
Signed-off-by: Dinghao Liu
---
drivers/platform/olpc/olpc-ec.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
When make_rate() fails, vcc should be freed just
like other error paths in fs_open().
Signed-off-by: Dinghao Liu
---
drivers/atm/firestream.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/atm/firestream.c b/drivers/atm/firestream.c
index 2ca9ec802734..510250cf5c87 100644
When clk_notifier_register() fails, ttcce should be freed
just like when clk_prepare_enable() and request_irq() fail.
Signed-off-by: Dinghao Liu
---
drivers/clocksource/timer-cadence-ttc.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/clocksource/timer-cadence-ttc.c
b/drivers
> On 8/23/20 12:13 AM, Dinghao Liu wrote:
> > When misc_register() fails, wd_data will be released by the
> > release callback function watchdog_core_data_release(), so
> > we don't need to free it again. But when watchdog_kworker is
> > NULL, we should free
When watchdog_kworker is NULL, we should free wd_data
before the function returns to prevent memleak.
Fixes: 664a39236e718 ("watchdog: Introduce hardware maximum heartbeat in
watchdog core")
Signed-off-by: Dinghao Liu
---
drivers/watchdog/watchdog_dev.c | 4 +++-
1 file changed, 3
We should use put_device() instead of freeing device
directly after device_initialize().
Fixes: cb36e29bb0e4b ("watchdog: initialize device before misc_register")
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Use put_device() instead of just removing kfree.
Move the me
hns_nic_dev_probe allocates ndev, but not free it on
two error handling paths, which may lead to memleak.
Fixes: 63434888aaf1b ("net: hns: net: hns: enet adds support of acpi")
Signed-off-by: Dinghao Liu
---
drivers/net/ethernet/hisilicon/hns/hns_enet.c | 9 ++---
1 file
When devm_kcalloc() fails, dev should be freed just
like what we've done in the subsequent error paths.
Fixes: 7b78be48a8eb6 ("net: systemport: Dynamically allocate number of TX
rings")
Signed-off-by: Dinghao Liu
---
drivers/net/ethernet/broadcom/bcmsysport.c | 6 --
1 file
When devm_ioremap_resource() fails, isp should be
freed just like other error paths in isp_probe.
Fixes: 8644cdf972dd6 ("[media] omap3isp: Replace many MMIO regions by two")
Signed-off-by: Dinghao Liu
---
drivers/media/platform/omap3isp/isp.c | 6 --
1 file changed, 4 insert
When input_mt_init_slots() fails, input should be
freed to prevent memleak.
Fixes: 9a6a4193d65b8 ("HID: Add driver for USB ELAN Touchpad")
Signed-off-by: Dinghao Liu
---
drivers/hid/hid-elan.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/hid/hid-elan.c b/drivers/hid/
When device_create() fails, dvbdev and dvbdevfops should
be freed just like when dvb_register_media_device() fails.
Signed-off-by: Dinghao Liu
---
drivers/media/dvb-core/dvbdev.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core
When nv50_lut_init() fails, *pwndw should be freed
just like when drm_universal_plane_init() fails.
It's the same for the subsequent error paths.
Signed-off-by: Dinghao Liu
---
drivers/gpu/drm/nouveau/dispnv50/wndw.c | 22 --
1 file changed, 12 insertions(+), 10 deletions
When ioread32() returns 0x, we should execute
cleanup functions like other error handling paths before
returning.
Signed-off-by: Dinghao Liu
---
drivers/scsi/fnic/vnic_dev.c | 8 +---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/scsi/fnic/vnic_dev.c b
When sdeb_zbc_model does not match BLK_ZONED_NONE,
BLK_ZONED_HA or BLK_ZONED_HM, we should free sdebug_q_arr
to prevent memleak. Also there is no need to execute
sdebug_erase_store() on failure of sdeb_zbc_model_str().
Signed-off-by: Dinghao Liu
---
drivers/scsi/scsi_debug.c | 4 ++--
1 file
When sdeb_zbc_model does not match BLK_ZONED_NONE,
BLK_ZONED_HA or BLK_ZONED_HM, we should free sdebug_q_arr
to prevent memleak. Also there is no need to execute
sdebug_erase_store() on failure of sdeb_zbc_model_str().
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Add missed assignment
When kzalloc() fails, we should execute hl_mmu_fini()
to release the MMU module. It's the same when
hl_ctx_init() fails.
Signed-off-by: Dinghao Liu
---
drivers/misc/habanalabs/common/device.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/misc/habanalabs/common/device.c
b
If usnic_ib_qp_grp_create() fails at the first call, dev_list
will not be freed on error, which leads to memleak.
Signed-off-by: Dinghao Liu
---
drivers/infiniband/hw/usnic/usnic_ib_verbs.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/infiniband/hw/usnic/usnic_ib_verbs.c
b
There is an allocation for priv->rx_urb[16] has no null check,
which may lead to a null pointer dereference.
Signed-off-by: Dinghao Liu
---
drivers/staging/rtl8192u/r8192U_core.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/staging/rtl8192u/r8192U_core.c
b/drivers/stag
> On Sun, Dec 20, 2020 at 04:13:14PM +0800, Dinghao Liu wrote:
> > When rdma_nl_multicast() fails, skb should be freed
> > just like when ibnl_put_msg() fails.
>
> It is not so simple as you wrote in the description.
>
> There are no other places in the linux ke
> On Mon, Dec 21, 2020 at 04:50:31PM +0800, Dinghao Liu wrote:
> > mlx5e_create_ttc_table_groups() frees ft->g on failure of
> > kvzalloc(), but such failure will be caught by its caller
> > in mlx5e_create_ttc_table() and ft->g will be freed again
> > in mlx5e_des
ter
kfree() to avoid double free.
Fixes: 7b3722fa9ef64 ("net/mlx5e: Support RSS for GRE tunneled packets")
Fixes: 33cfaaa8f36ff ("net/mlx5e: Split the main flow steering table")
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Set ft->g to NULL after kfree() instead of remov
oherent buffer for DMA
transfers")
Signed-off-by: Dinghao Liu
---
drivers/media/usb/em28xx/em28xx-core.c | 6 +-
1 file changed, 1 insertion(+), 5 deletions(-)
diff --git a/drivers/media/usb/em28xx/em28xx-core.c
b/drivers/media/usb/em28xx/em28xx-core.c
index e6088b5d1b80..3daa64bb1e1d 100644
> On Sun, Dec 20, 2020 at 03:05:40PM +0800, Dinghao Liu wrote:
> > When do_ide_setup_pci_device() fails, host allocated
> > by ide_host_alloc() may not have been freed, which
> > leads to memleak.
> >
> > Signed-off-by: Dinghao Liu
> > ---
> > dri
When do_ide_setup_pci_device() fails, host allocated
by ide_host_alloc() may not have been freed, which
leads to memleak.
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Refine the error handling on failure of
ide_host_register().
---
drivers/ide/setup-pci.c | 10 ++
1 file
When mdiobus_register() fails, priv->mdio allocated
by mdiobus_alloc() has not been freed, which leads
to memleak.
Signed-off-by: Dinghao Liu
---
drivers/net/ethernet/ethoc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/ethoc.c b/drivers/
The error handling paths in enic_alloc_vnic_resources()
have called enic_free_vnic_resources() before returning.
So we may not need to call it again on failure at caller
side.
Signed-off-by: Dinghao Liu
---
drivers/net/ethernet/cisco/enic/enic_ethtool.c | 1 -
1 file changed, 1 deletion
> On Wed, 23 Dec 2020 20:38:33 +0800 Dinghao Liu wrote:
> > The error handling paths in enic_alloc_vnic_resources()
> > have called enic_free_vnic_resources() before returning.
> > So we may not need to call it again on failure at caller
> > side.
> >
> > Si
When do_ide_setup_pci_device() fails, host allocated
by ide_host_alloc() may not have been freed, which
leads to memleak.
Signed-off-by: Dinghao Liu
---
drivers/ide/setup-pci.c | 8
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/ide/setup-pci.c b/drivers/ide
When rdma_nl_multicast() fails, skb should be freed
just like when ibnl_put_msg() fails.
Signed-off-by: Dinghao Liu
---
drivers/infiniband/core/sa_query.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/infiniband/core/sa_query.c
b/drivers/infiniband/core
When mvneta_port_power_up() fails, we should execute
cleanup functions after label err_netdev to avoid memleak.
Fixes: 41c2b6b4f0f80 ("net: ethernet: mvneta: Add back interface mode
validation")
Signed-off-by: Dinghao Liu
---
drivers/net/ethernet/marvell/mvneta.c | 2 +-
1 file
mlx5e_create_ttc_table_groups() frees ft->g on failure of
kvzalloc(), but such failure will be caught by its caller
in mlx5e_create_ttc_table() and ft->g will be freed again
in mlx5e_destroy_flow_table(). The same issue also occurs
in mlx5e_create_ttc_table_groups().
Signed-off-by: Dingh
When mlx5_create_flow_group() fails, ft->g should be
freed just like when kvzalloc() fails. The caller of
mlx5e_create_l2_table_groups() does not catch this
issue on failure, which leads to memleak.
Signed-off-by: Dinghao Liu
---
drivers/net/ethernet/mellanox/mlx5/core/en_fs.c | 1 +
1 f
When fw_core_add_address_handler() fails, we need to destroy
the port by tty_port_destroy(). Also we need to unregister
the address handler by fw_core_remove_address_handler() on
failure.
Signed-off-by: Dinghao Liu
---
drivers/staging/fwserial/fwserial.c | 2 ++
1 file changed, 2 insertions
> On 1/3/21 2:22 PM, dinghao@zju.edu.cn wrote:
> >> On 2021/1/3 12:08, dinghao@zju.edu.cn wrote:
> >>>> Hi,
> >>>>
> >>>> On 2021/1/2 17:50, Dinghao Liu wrote:
> >>>>> When irq_domain_get_irq_data() or
When irq_domain_get_irq_data() or irqd_cfg() fails
at i == 0, data allocated by kzalloc() has not been
freed before returning, which leads to memleak.
Fixes: b106ee63abccb ("irq_remapping/vt-d: Enhance Intel IR driver to support
hierarchical irqdomains")
Signed-off-by: D
When crypto_shash_digestsize() fails, c->hmac_tfm
has not been freed before returning, which leads
to memleak.
Fixes: 49525e5eecca5 ("ubifs: Add helper functions for authentication support")
Signed-off-by: Dinghao Liu
---
fs/ubifs/auth.c | 2 +-
1 file changed, 1 insertion(+
When videobuf_waiton() fails, we should execute clean
functions to prevent memleak. It's the same when
__videobuf_copy_to_user() fails.
Fixes: 7a7d9a89d0307 ("V4L/DVB (6251): Replace video-buf to a more generic
approach")
Signed-off-by: Dinghao Liu
---
drivers/media/v4l2-core/video
When __le32_to_cpu() fails, qca_memdump should be freed
just like when vmalloc() fails.
Fixes: d841502c79e3f ("Bluetooth: hci_qca: Collect controller memory dump
during SSR")
Signed-off-by: Dinghao Liu
---
drivers/bluetooth/hci_qca.c | 2 ++
1 file changed, 2 insertions(+)
When vb2_queue_init() fails, dev->empress_dev
should be released just like other error handling
paths.
Fixes: 2ada815fc48bb ("[media] saa7134: convert to vb2")
Signed-off-by: Dinghao Liu
---
drivers/media/pci/saa7134/saa7134-empress.c | 5 -
1 file changed, 4 insertions(+
When usb_clear_halt() fails, dvb->bulk_urb->transfer_buffer
and dvb->bulk_urb should be freed just like when
usb_submit_urb() fails.
Fixes: 3169c9b26fffa ("V4L/DVB (12788): tm6000: Add initial DVB-T support")
Signed-off-by: Dinghao Liu
---
drivers/media/usb/tm6000/tm6000-dvb
When irq_domain_get_irq_data() or irqd_cfg() fails
meanwhile i == 0, data allocated by kzalloc() has not
been freed before returning, which leads to memleak.
Fixes: b106ee63abccb ("irq_remapping/vt-d: Enhance Intel IR driver to support
hierarchical irqdomains")
Signed-off-by: D
> Hi,
>
> On 2021/1/2 17:50, Dinghao Liu wrote:
> > When irq_domain_get_irq_data() or irqd_cfg() fails
> > meanwhile i == 0, data allocated by kzalloc() has not
> > been freed before returning, which leads to memleak.
> >
> > Fixes: b106ee63abccb ("
> On 2021/1/3 12:08, dinghao@zju.edu.cn wrote:
> >> Hi,
> >>
> >> On 2021/1/2 17:50, Dinghao Liu wrote:
> >>> When irq_domain_get_irq_data() or irqd_cfg() fails
> >>> meanwhile i == 0, data allocated by kzalloc() has not
>
When ixgbe_fdir_write_perfect_filter_82599() fails,
input allocated by kzalloc() has not been freed,
which leads to memleak.
Signed-off-by: Dinghao Liu
---
drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 6 --
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/drivers/net
> Dear Dinghao,
>
>
> Am 03.01.21 um 09:08 schrieb Dinghao Liu:
> > When ixgbe_fdir_write_perfect_filter_82599() fails,
> > input allocated by kzalloc() has not been freed,
> > which leads to memleak.
>
> Nice find. Thank you for your patches. Out of curio
When rtnl_configure_link() fails, peer needs to be
freed just like when register_netdevice() fails.
Signed-off-by: Dinghao Liu
---
drivers/net/can/vxcan.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/net/can/vxcan.c b/drivers/net/can/vxcan.c
index d6ba9426be4d..aefc5a61d239
There is one error handling path does not free ref,
which may cause a memory leak.
Signed-off-by: Dinghao Liu
---
fs/btrfs/ref-verify.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/fs/btrfs/ref-verify.c b/fs/btrfs/ref-verify.c
index 7f03dbe5b609..78693d3dd15b 100644
--- a/fs/btrfs/ref
>
> On 21.10.20 07:21, Dinghao Liu wrote:
> > When rtnl_configure_link() fails, peer needs to be
> > freed just like when register_netdevice() fails.
> >
> > Signed-off-by: Dinghao Liu
>
> Acked-by: Oliver Hartkopp
>
> Btw. as the vxcan.c driver b
When rtnl_configure_link() fails, peer needs to be
freed just like when register_netdevice() fails.
Signed-off-by: Dinghao Liu
---
drivers/net/veth.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/drivers/net/veth.c b/drivers/net/veth.c
index 8c737668008a..6c68094399cc 100644
When radeon_kick_out_firmware_fb() fails, info should be
freed just like the subsequent error paths.
Fixes: 069ee21a82344 ("fbdev: Fix loading of module radeonfb on PowerMac")
Signed-off-by: Dinghao Liu
---
drivers/video/fbdev/aty/radeon_base.c | 2 +-
1 file changed, 1 insertion(+),
When platform_get_irq() fails, we should release
vfd and unregister pcdev->v4l2_dev just like the
subsequent error paths.
Fixes: d4e192cc44914 ("media: mx2_emmaprp: Check for platform_get_irq() error")
Signed-off-by: Dinghao Liu
---
drivers/media/platform/mx2_emmaprp.c | 2 +-
1 fi
> On Sun, Aug 23, 2020 at 3:59 PM Dinghao Liu wrote:
> >
> > When clk_hw_register_fixed_rate_with_accuracy() fails,
> > clk_data should be freed. It's the same for the subsequent
> > error paths.
>
> I suppose you should also unregister the already registered
> On 25/08/2020 11:39, Dinghao Liu wrote:
> > When platform_get_irq() fails, we should release
> > vfd and unregister pcdev->v4l2_dev just like the
> > subsequent error paths.
> >
> > Fixes: d4e192cc44914 ("media: mx2_emmaprp: Check for platform_get_irq(
When do_ide_setup_pci_device() fails, host should be
freed just like when ide_host_register() fails.
Signed-off-by: Dinghao Liu
---
drivers/ide/setup-pci.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/drivers/ide/setup-pci.c b/drivers/ide/setup-pci.c
index fdc8e813170c
When platform_get_irq() fails, we should release
vfd and unregister pcdev->v4l2_dev just like the
subsequent error paths.
Fixes: d4e192cc44914 ("media: mx2_emmaprp: Check for platform_get_irq() error")
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Add 'ret = irq;'.
---
When of_property_read_u32_array() returns an error code, a
pairing refcount decrement is needed to keep np's refcount
balanced.
Fixes: f705806c9f355 ("backlight: Add support Skyworks SKY81452 backlight
driver")
Signed-off-by: Dinghao Liu
---
drivers/video/backlight/sky81452-backl
When page_address() fails, umem should be freed just
like when rxe_mem_alloc() fails.
Signed-off-by: Dinghao Liu
---
drivers/infiniband/sw/rxe/rxe_mr.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/infiniband/sw/rxe/rxe_mr.c
b/drivers/infiniband/sw/rxe/rxe_mr.c
index cdd811a45120
When verify_crc_source() fails, source needs to be freed.
However, current code is returning directly and ends up
leaking memory.
Fixes: c0811a7d5befe ("drm/crc: Cleanup crtc_crc_open function")
Signed-off-by: Dinghao Liu
---
drivers/gpu/drm/drm_debugfs_crc.c | 4 +++-
1 file
When devm_clk_get() returns -EPROBE_DEFER, sdio_priv
should be freed just like when wilc_cfg80211_init()
fails.
Fixes: 8692b047e86cf ("staging: wilc1000: look for rtc_clk clock")
Signed-off-by: Dinghao Liu
---
drivers/net/wireless/microchip/wilc1000/sdio.c | 5 +++--
1 file
When devm_clk_get() returns -EPROBE_DEFER, spi_priv
should be freed just like when wilc_cfg80211_init()
fails.
Fixes: 854d66df74aed ("staging: wilc1000: look for rtc_clk clock in spi mode")
Signed-off-by: Dinghao Liu
---
drivers/net/wireless/microchip/wilc1000/spi.c | 5 +++--
1 file
> On Wed, 19 Aug 2020, Markus Elfring wrote:
>
> > > When of_property_read_u32_array() returns an error code,
> > > a pairing refcount decrement is needed to keep np's refcount balanced.
> >
> > Can another imperative wording be helpful for the change description?
> >
for_each_child_of_node returns a node pointer np with
refcount incremented. So when devm_kzalloc fails, a
pairing refcount decrement is needed to keep np's
refcount balanced.
Fixes: 16395ceee11f8 ("ASoC: qcom: common: Fix NULL pointer in of parser")
Signed-off-by: Dinghao Liu
---
soun
ajay.kat...@microchip.com写道:
> Thanks for submitting the patch. The code changes looks okay to me.
>
> The driver is now moved out of staging so 'staging' prefix is not
> required in subject. For future patches on wilc driver, the 'staging'
> prefix can be removed.
>
> For this patch, I am not
When devm_clk_get() returns -EPROBE_DEFER, sdio_priv
should be freed just like when wilc_cfg80211_init()
fails.
Fixes: 8692b047e86cf ("staging: wilc1000: look for rtc_clk clock")
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Remove 'staging' prefix in subject.
---
drivers/ne
When devm_clk_get() returns -EPROBE_DEFER, spi_priv
should be freed just like when wilc_cfg80211_init()
fails.
Fixes: 854d66df74aed ("staging: wilc1000: look for rtc_clk clock in spi mode")
Signed-off-by: Dinghao Liu
---
Changelog:
v2: - Remove 'staging' prefix in subject.
---
d
1 - 100 of 381 matches
Mail list logo