[PATCH v2] qed: Add cleanup in qed_slowpath_start()

2019-08-20 Thread Wenwen Wang
If qed_mcp_send_drv_version() fails, no cleanup is executed, leading to memory leaks. To fix this issue, introduce the label 'err4' to perform the cleanup work before returning the error. Signed-off-by: Wenwen Wang --- drivers/net/ethernet/qlogic/qed/qed_main.c | 4 +++- 1 file

Re: [EXT] [PATCH] qed: Add cleanup in qed_slowpath_start()

2019-08-20 Thread Wenwen Wang
On Tue, Aug 13, 2019 at 6:46 AM Sudarsana Reddy Kalluru wrote: > > > -Original Message- > > From: Wenwen Wang > > Sent: Tuesday, August 13, 2019 3:35 PM > > To: Wenwen Wang > > Cc: Ariel Elior ; GR-everest-linux-l2 > l...@marvell.com>; David

[PATCH v2] net: pch_gbe: Fix memory leaks

2019-08-20 Thread Wenwen Wang
In pch_gbe_set_ringparam(), if netif_running() returns false, 'tx_old' and 'rx_old' are not deallocated, leading to memory leaks. To fix this issue, move the free statements to the outside of the if() statement. Signed-off-by: Wenwen Wang --- drivers/net/ether

Re: [PATCH] net: pch_gbe: Fix memory leaks

2019-08-20 Thread Wenwen Wang
On Thu, Aug 15, 2019 at 4:51 PM David Miller wrote: > > From: Wenwen Wang > Date: Thu, 15 Aug 2019 16:46:05 -0400 > > > On Thu, Aug 15, 2019 at 4:42 PM David Miller wrote: > >> > >> From: Wenwen Wang > >> Date: Thu, 15 Aug 2019 16:03:39 -0400 >

[PATCH v2] ACPI / PCI: fix acpi_pci_irq_enable() memory leak

2019-08-20 Thread Wenwen Wang
Fixes: e237a5518425 ("x86/ACPI/PCI: Recognize that Interrupt Line 255 means "not connected"") Signed-off-by: Wenwen Wang --- drivers/acpi/pci_irq.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/acpi/pci_irq.c b/drivers/acpi/pci_irq.c index d2

Re: [PATCH] ACPI / PCI: fix a memory leak bug

2019-08-20 Thread Wenwen Wang
On Mon, Aug 19, 2019 at 5:23 PM Bjorn Helgaas wrote: > > The subject line should give a clue about where the leak is, e.g., > > ACPI / PCI: fix acpi_pci_irq_enable() memory leak > > On Thu, Aug 15, 2019 at 11:33:22PM -0500, Wenwen Wang wrote: > > In acpi_pci_irq_enable

[PATCH v2] NFSv4: Fix a memory leak bug

2019-08-20 Thread Wenwen Wang
In nfs4_try_migration(), if nfs4_begin_drain_session() fails, the previously allocated 'page' and 'locations' are not deallocated, leading to memory leaks. To fix this issue, go to the 'out' label to free 'page' and 'locations' before returning t

Re: [PATCH] NFSv4: Fix a memory leak bug

2019-08-20 Thread Wenwen Wang
On Tue, Aug 20, 2019 at 9:41 AM Schumaker, Anna wrote: > > Hi Wenwen, > > On Tue, 2019-08-20 at 02:54 -0500, Wenwen Wang wrote: > > In nfs4_try_migration(), if nfs4_begin_drain_session() fails, the > > previously allocated 'page' and 'locations' ar

[PATCH] NFSv4: Fix a memory leak bug

2019-08-20 Thread Wenwen Wang
In nfs4_try_migration(), if nfs4_begin_drain_session() fails, the previously allocated 'page' and 'locations' are not deallocated, leading to memory leaks. To fix this issue, free 'page' and 'locations' before returning the error. Signed-off-by: Wenwen Wan

[PATCH] omfs: Fix a memory leak bug

2019-08-19 Thread Wenwen Wang
In omfs_get_imap(), 'sbi->s_imap' is allocated through kcalloc(). However, it is not deallocated in the following execution if 'block' is not less than 'sbi->s_num_blocks', leading to a memory leak bug. To fix this issue, go to the 'nomem_free' label

[PATCH] ecryptfs: fix a memory leak bug

2019-08-19 Thread Wenwen Wang
In ecryptfs_init_messaging(), if the allocation for 'ecryptfs_msg_ctx_arr' fails, the previously allocated 'ecryptfs_daemon_hash' is not deallocated, leading to a memory leak bug. To fix this issue, free 'ecryptfs_daemon_hash' before returning the error. Signe

[PATCH] ecryptfs: fix a memory leak bug

2019-08-19 Thread Wenwen Wang
In parse_tag_1_packet(), if tag 1 packet contains a key larger than ECRYPTFS_MAX_ENCRYPTED_KEY_BYTES, no cleanup is executed, leading to a memory leak on the allocated 'auth_tok_list_item'. To fix this issue, go to the label 'out_free' to perform the cleanup work. Signed

[PATCH] ubifs: fix a memory leak bug

2019-08-19 Thread Wenwen Wang
In ubifs_mount(), 'c' is allocated through kzalloc() in alloc_ubifs_info(). However, it is not deallocated in the following execution if ubifs_fill_super() fails, leading to a memory leak bug. To fix this issue, free 'c' before going to the 'out_deact' label. Signe

[PATCH] ubifs: fix a memory leak bug

2019-08-19 Thread Wenwen Wang
In __ubifs_node_verify_hmac(), 'hmac' is allocated through kmalloc(). However, it is not deallocated in the following execution if ubifs_node_calc_hmac() fails, leading to a memory leak bug. To fix this issue, free 'hmac' before returning the error. Signed-off-by: Wenwen

[PATCH] ubifs: fix a memory leak bug

2019-08-19 Thread Wenwen Wang
In read_znode(), the indexing node 'idx' is allocated by kmalloc(). However, it is not deallocated in the following execution if ubifs_node_check_hash() fails, leading to a memory leak bug. To fix this issue, free 'idx' before returning the error. Signed-off-by: Wenwen

[PATCH] locks: fix a memory leak bug

2019-08-19 Thread Wenwen Wang
In __break_lease(), the file lock 'new_fl' is allocated in lease_alloc(). However, it is not deallocated in the following execution if smp_load_acquire() fails, leading to a memory leak bug. To fix this issue, free 'new_fl' before returning the error. Signed-off-by: Wenwen W

[PATCH] jffs2: fix a memory leak bug

2019-08-19 Thread Wenwen Wang
x27; before returning the error. Signed-off-by: Wenwen Wang --- fs/jffs2/scan.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/fs/jffs2/scan.c b/fs/jffs2/scan.c index 90431dd..5f7e284 100644 --- a/fs/jffs2/scan.c +++ b/fs/jffs2/scan.c @@ -527,8 +527,11 @@ static int jffs2_

[PATCH] led: triggers: Fix a memory leak bug

2019-08-19 Thread Wenwen Wang
In led_trigger_set(), 'event' is allocated in kasprintf(). However, it is not deallocated in the following execution if the label 'err_activate' or 'err_add_groups' is entered, leading to memory leaks. To fix this issue, free 'event' before returnin

[PATCH v2] mtd: spi-nor: fix a memory leak bug

2019-08-19 Thread Wenwen Wang
pi-nor: parse SFDP 4-byte Address Instruction Table") Signed-off-by: Wenwen Wang --- drivers/mtd/spi-nor/spi-nor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/mtd/spi-nor/spi-nor.c b/drivers/mtd/spi-nor/spi-nor.c index 03cc788..a41a466 100644 --- a/drivers/mtd/s

Re: [PATCH] mtd: spi-nor: fix a memory leak bug

2019-08-19 Thread Wenwen Wang
On Mon, Aug 19, 2019 at 2:03 AM wrote: > > > > On 08/18/2019 08:39 PM, Wenwen Wang wrote: > > In spi_nor_parse_4bait(), 'dwords' is allocated through kmalloc(). However, > > it is not deallocated in the following execution if spi_nor_read_sfdp() > > fail

[PATCH v2] mtd: rawnand: Fix a memory leak bug

2019-08-18 Thread Wenwen Wang
In nand_scan_bbt(), a temporary buffer 'buf' is allocated through vmalloc(). However, if check_create() fails, 'buf' is not deallocated, leading to a memory leak bug. To fix this issue, free 'buf' before returning the error. Signed-off-by: Wenwen Wang --- driver

[PATCH] IB/mlx4: Fix memory leaks

2019-08-18 Thread Wenwen Wang
In mlx4_ib_alloc_pv_bufs(), 'tun_qp->tx_ring' is allocated through kcalloc(). However, it is not always deallocated in the following execution if an error occurs, leading to memory leaks. To fix this issue, free 'tun_qp->tx_ring' whenever an error occurs. Signed-off-by:

[PATCH] infiniband: hfi1: fix a memory leak bug

2019-08-18 Thread Wenwen Wang
In fault_opcodes_read(), 'data' is not deallocated if debugfs_file_get() fails, leading to a memory leak. To fix this bug, introduce the 'free_data' label to free 'data' before returning the error. Signed-off-by: Wenwen Wang --- drivers/infiniband/hw/hfi1/faul

[PATCH] infiniband: hfi1: fix memory leaks

2019-08-18 Thread Wenwen Wang
In fault_opcodes_write(), 'data' is allocated through kcalloc(). However, it is not deallocated in the following execution if an error occurs, leading to memory leaks. To fix this issue, introduce the 'free_data' label to free 'data' before returning the erro

[PATCH] mtd: spi-nor: fix a memory leak bug

2019-08-18 Thread Wenwen Wang
In spi_nor_parse_4bait(), 'dwords' is allocated through kmalloc(). However, it is not deallocated in the following execution if spi_nor_read_sfdp() fails, leading to a memory leak. To fix this issue, free 'dwords' before returning the error. Signed-off-by: Wenwen Wang ---

[PATCH] mtd: sm_ftl: fix memory leaks

2019-08-18 Thread Wenwen Wang
fix this issue, free them before returning -EIO. Signed-off-by: Wenwen Wang --- drivers/mtd/sm_ftl.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/mtd/sm_ftl.c b/drivers/mtd/sm_ftl.c index dfc47a4..4744bf9 100644 --- a/drivers/mtd/sm_ftl.c +++ b/drivers/mtd/sm_ftl.c @

[PATCH] mtd: onenand_base: Fix a memory leak bug

2019-08-18 Thread Wenwen Wang
ue, free 'this->verify_buf' before returning the error. Signed-off-by: Wenwen Wang --- drivers/mtd/nand/onenand/onenand_base.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/drivers/mtd/nand/onenand/onenand_base.c b/drivers/mtd/nand/onenand/onenand_base.c index e082d63..77bd32

[PATCH] mtd: rawnand: Fix a memory leak bug

2019-08-18 Thread Wenwen Wang
In nand_scan_bbt(), a temporary buffer 'buf' is allocated through vmalloc(). However, if check_create() fails, 'buf' is not deallocated, leading to a memory leak bug. To fix this issue, free 'buf' before returning the error. Signed-off-by: Wenwen Wang --- drive

[PATCH] media: ti-vpe: Add cleanup in vpdma_list_cleanup()

2019-08-17 Thread Wenwen Wang
If an error occurs in this function, no cleanup is executed, leading to memory/resource leaks. To fix this issue, introduce two labels to perform the cleanup work. Signed-off-by: Wenwen Wang --- drivers/media/platform/ti-vpe/vpdma.c | 10 ++ 1 file changed, 6 insertions(+), 4 deletions

[PATCH] media: fdp1: Fix a memory leak bug

2019-08-17 Thread Wenwen Wang
In fdp1_open(), 'ctx' is allocated through kzalloc(). However, it is not deallocated if v4l2_ctrl_new_std() fails, leading to a memory leak bug. To fix this issue, free 'ctx' before going to the 'done' label. Signed-off-by: Wenwen Wang --- drivers/media/plat

[PATCH v2] media: saa7146: add cleanup in hexium_attach()

2019-08-17 Thread Wenwen Wang
If saa7146_register_device() fails, no cleanup is executed, leading to memory/resource leaks. To fix this issue, perform necessary cleanup work before returning the error. Signed-off-by: Wenwen Wang --- drivers/media/pci/saa7146/hexium_gemini.c | 3 +++ 1 file changed, 3 insertions(+) diff

[PATCH] media: saa7146: add cleanup in hexium_attach()

2019-08-17 Thread Wenwen Wang
If saa7146_register_device(), no cleanup is executed, leading to memory/resource leaks. To fix this issue, perform necessary cleanup work before returning the error. Signed-off-by: Wenwen Wang --- drivers/media/pci/saa7146/hexium_gemini.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a

[PATCH] media: dvb-core: fix a memory leak bug

2019-08-17 Thread Wenwen Wang
his issue, free 'dvbdev->entity' before returning -ENOMEM. Signed-off-by: Wenwen Wang --- drivers/media/dvb-core/dvbdev.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/media/dvb-core/dvbdev.c b/drivers/media/dvb-core/dvbdev.c index a3393cd..7557fbf 100644

[PATCH] media: dvb-frontends: fix a memory leak bug

2019-08-17 Thread Wenwen Wang
In cx24117_load_firmware(), 'buf' is allocated through kmalloc() to hold the firmware. However, if i2c_transfer() fails, it is not deallocated, leading to a memory leak bug. Signed-off-by: Wenwen Wang --- drivers/media/dvb-frontends/cx24117.c | 4 +++- 1 file changed, 3 insert

[PATCH] media: dvb-frontends: fix memory leaks

2019-08-16 Thread Wenwen Wang
In dib7000pc_detection(), 'tx' and 'rx' are allocated through kzalloc() respectively. However, if DiB7000PC is detected, they are not deallocated, leading to memory leaks. To fix this issue, create a label to free 'tx' and 'rx' before returning from t

[PATCH] media: usb: cx231xx-417: fix a memory leak bug

2019-08-16 Thread Wenwen Wang
In cx231xx_load_firmware(), 'p_buffer' is allocated through vmalloc() to hold the firmware. However, after the usage, it is not deallocated, leading to a memory leak bug. Signed-off-by: Wenwen Wang --- drivers/media/usb/cx231xx/cx231xx-417.c | 1 + 1 file changed, 1 insertion(+) di

[PATCH] media: cpia2_usb: fix memory leaks

2019-08-16 Thread Wenwen Wang
In submit_urbs(), 'cam->sbuf[i].data' is allocated through kmalloc_array(). However, it is not deallocated if the following allocation for urbs fails. To fix this issue, free 'cam->sbuf[i].data' if usb_alloc_urb() fails. Signed-off-by: Wenwen Wang --- drivers/media

[PATCH] libata: Fix a memory leak bug

2019-08-16 Thread Wenwen Wang
In ata_init(), 'ata_force_tbl' is allocated through kcalloc() in ata_parse_force_param(). However, it is not deallocated if ata_attach_transport() fails, leading to a memory leak bug. To fix this issue, free 'ata_force_tbl' before go to the 'err_out' labe

[PATCH] dmaengine: ti: omap-dma: Add cleanup in omap_dma_probe()

2019-08-15 Thread Wenwen Wang
If devm_request_irq() fails to disable all interrupts, no cleanup is performed before retuning the error. To fix this issue, invoke omap_dma_free() to do the cleanup. Signed-off-by: Wenwen Wang --- drivers/dma/ti/omap-dma.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a

[PATCH v2] dmaengine: ti: dma-crossbar: Fix a memory leak bug

2019-08-15 Thread Wenwen Wang
nts' before returning the error. Signed-off-by: Wenwen Wang --- drivers/dma/ti/dma-crossbar.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/dma/ti/dma-crossbar.c b/drivers/dma/ti/dma-crossbar.c index ad2f0a4..f255056 100644 --- a/drivers/dma/ti/dma-cross

Re: [PATCH] dmaengine: ti: Fix a memory leak bug

2019-08-15 Thread Wenwen Wang
On Fri, Aug 16, 2019 at 2:42 AM Peter Ujfalusi wrote: > > > > On 16/08/2019 9.23, Wenwen Wang wrote: > > In ti_dra7_xbar_probe(), 'rsv_events' is allocated through kcalloc(). Then > > of_property_read_u32_array() is invoked to search for the property.

[PATCH] dmaengine: ti: Fix a memory leak bug

2019-08-15 Thread Wenwen Wang
nts' before returning the error. Signed-off-by: Wenwen Wang --- drivers/dma/ti/dma-crossbar.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/dma/ti/dma-crossbar.c b/drivers/dma/ti/dma-crossbar.c index ad2f0a4..f255056 100644 --- a/drivers/dma/ti/dma-cross

[PATCH] ACPI: custom_method: fix memory leaks

2019-08-15 Thread Wenwen Wang
In cm_write(), 'buf' is allocated through kzalloc(). In the following execution, if an error occurs, 'buf' is not deallocated, leading to memory leaks. To fix this issue, free 'buf' before returning the error. Signed-off-by: Wenwen Wang --- drivers/acpi/custom_meth

[PATCH] ACPI / PCI: fix a memory leak bug

2019-08-15 Thread Wenwen Wang
In acpi_pci_irq_enable(), 'entry' is allocated by invoking acpi_pci_irq_lookup(). However, it is not deallocated if acpi_pci_irq_valid() returns false, leading to a memory leak. To fix this issue, free 'entry' before returning 0. Signed-off-by: Wenwen Wang --- drivers/acpi/p

[PATCH] airo: fix memory leaks

2019-08-15 Thread Wenwen Wang
y regions before returning the error. Signed-off-by: Wenwen Wang --- drivers/net/wireless/cisco/airo.c | 11 +-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/drivers/net/wireless/cisco/airo.c b/drivers/net/wireless/cisco/airo.c index 9342ffb..f43c065 100644 --- a/drivers

Re: [PATCH] net: pch_gbe: Fix memory leaks

2019-08-15 Thread Wenwen Wang
On Thu, Aug 15, 2019 at 4:42 PM David Miller wrote: > > From: Wenwen Wang > Date: Thu, 15 Aug 2019 16:03:39 -0400 > > > On Thu, Aug 15, 2019 at 3:34 PM David Miller wrote: > >> > >> From: Wenwen Wang > >> Date: Tue, 13 Aug 2019 20:33:45 -05

[PATCH v2] wimax/i2400m: fix a memory leak bug

2019-08-15 Thread Wenwen Wang
fix this issue, free 'options_orig' before returning the error. Signed-off-by: Wenwen Wang --- drivers/net/wimax/i2400m/fw.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/net/wimax/i2400m/fw.c b/drivers/net/wimax/i2400m/fw.c index e9fc168..489cba9 100644 --- a

Re: [PATCH] wimax/i2400m: fix a memory leak bug

2019-08-15 Thread Wenwen Wang
On Thu, Aug 15, 2019 at 2:45 PM Liam R. Howlett wrote: > > * Wenwen Wang [190815 14:05]: > > In i2400m_barker_db_init(), 'options_orig' is allocated through kstrdup() > > to hold the original command line options. Then, the options are parsed. > > However, if

Re: [PATCH] net: pch_gbe: Fix memory leaks

2019-08-15 Thread Wenwen Wang
On Thu, Aug 15, 2019 at 3:34 PM David Miller wrote: > > From: Wenwen Wang > Date: Tue, 13 Aug 2019 20:33:45 -0500 > > > In pch_gbe_set_ringparam(), if netif_running() returns false, 'tx_old' and > > 'rx_old' are not deallocated, leading to memory

[PATCH] wimax/i2400m: fix a memory leak bug

2019-08-15 Thread Wenwen Wang
fix this issue, free 'options_orig' before returning the error. Signed-off-by: Wenwen Wang --- drivers/net/wimax/i2400m/fw.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/drivers/net/wimax/i2400m/fw.c b/drivers/net/wimax/i2400m/fw.c index e9fc168..6b36f6d 100644 --- a

[PATCH] hv_netvsc: Fix a memory leak bug

2019-08-14 Thread Wenwen Wang
, leading to a memory leak bug. Signed-off-by: Wenwen Wang --- drivers/net/hyperv/rndis_filter.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/hyperv/rndis_filter.c b/drivers/net/hyperv/rndis_filter.c index 317dbe9..ed35085 100644 --- a/drivers/net/hyperv/rndis_filter.c +++ b/dri

[PATCH] cx82310_eth: fix a memory leak bug

2019-08-14 Thread Wenwen Wang
, leading to a memory leak bug. To fix this issue, free 'dev->partial_data' before returning the error. Signed-off-by: Wenwen Wang --- drivers/net/usb/cx82310_eth.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/usb/cx82310_eth.c b/drivers/net/u

[PATCH] net: usbnet: fix a memory leak bug

2019-08-14 Thread Wenwen Wang
this execution path, leading to a memory leak bug. Signed-off-by: Wenwen Wang --- drivers/net/usb/usbnet.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/net/usb/usbnet.c b/drivers/net/usb/usbnet.c index 72514c4..f17fafa 100644 --- a/drivers/net/usb/usbnet.c +++ b/drivers/net/

[PATCH] net: myri10ge: fix memory leaks

2019-08-13 Thread Wenwen Wang
target label of the goto statement to 'abort_with_slices'. Signed-off-by: Wenwen Wang --- drivers/net/ethernet/myricom/myri10ge/myri10ge.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/myricom/myri10ge/myri10ge.c b/drivers/net/ethernet/myrico

[PATCH] liquidio: add cleanup in octeon_setup_iq()

2019-08-13 Thread Wenwen Wang
If oct->fn_list.enable_io_queues() fails, no cleanup is executed, leading to memory/resource leaks. To fix this issue, invoke octeon_delete_instr_queue() before returning from the function. Signed-off-by: Wenwen Wang --- drivers/net/ethernet/cavium/liquidio/request_manager.c | 4 +++- 1 f

[PATCH] net: pch_gbe: Fix memory leaks

2019-08-13 Thread Wenwen Wang
In pch_gbe_set_ringparam(), if netif_running() returns false, 'tx_old' and 'rx_old' are not deallocated, leading to memory leaks. To fix this issue, move the free statements after the if branch. Signed-off-by: Wenwen Wang --- drivers/net/ethernet/oki-semi/pch_gbe/pch_gbe_e

[PATCH] qed: Add cleanup in qed_slowpath_start()

2019-08-13 Thread Wenwen Wang
If qed_mcp_send_drv_version() fails, no cleanup is executed, leading to memory leaks. To fix this issue, redirect the execution to the label 'err3' before returning the error. Signed-off-by: Wenwen Wang --- drivers/net/ethernet/qlogic/qed/qed_main.c | 2 +- 1 file changed, 1 inser

[PATCH] cxgb4: fix a memory leak bug

2019-08-13 Thread Wenwen Wang
In blocked_fl_write(), 't' is not deallocated if bitmap_parse_user() fails, leading to a memory leak bug. To fix this issue, free t before returning the error. Signed-off-by: Wenwen Wang --- drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c | 4 +++- 1 file changed, 3 insertions(+),

[PATCH] net/mlx5: Fix a memory leak bug

2019-08-13 Thread Wenwen Wang
deallocated on this program path, leading to a memory leak bug. To fix the above issue, free 'ent' before returning the error. Signed-off-by: Wenwen Wang --- drivers/net/ethernet/mellanox/mlx5/core/cmd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/eth

[PATCH v2] net/mlx4_en: fix a memory leak bug

2019-08-12 Thread Wenwen Wang
g. To fix the above issue, add the 'qp_alloc_err' label to free 'rss_map->indir_qp'. Fixes: 4931c6ef04b4 ("net/mlx4_en: Optimized single ring steering") Signed-off-by: Wenwen Wang --- drivers/net/ethernet/mellanox/mlx4/en_rx.c | 3 ++- 1 file changed, 2 inse

Re: [PATCH] net/mlx4_en: fix a memory leak bug

2019-08-12 Thread Wenwen Wang
On Mon, Aug 12, 2019 at 5:05 AM Tariq Toukan wrote: > > Hi Wenwen, > > Thanks for your patch. > > On 8/12/2019 9:36 AM, Wenwen Wang wrote: > > In mlx4_en_config_rss_steer(), 'rss_map->indir_qp' is allocated through > > kzalloc(). After that,

[PATCH] net/mlx4_en: fix a memory leak bug

2019-08-11 Thread Wenwen Wang
g. To fix the above issue, add the 'mlx4_err' label to free 'rss_map->indir_qp'. Signed-off-by: Wenwen Wang --- drivers/net/ethernet/mellanox/mlx4/en_rx.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/net/ethernet/mellanox/mlx4/en_rx.c b

[PATCH] e1000: fix memory leaks

2019-08-11 Thread Wenwen Wang
In e1000_set_ringparam(), 'tx_old' and 'rx_old' are not deallocated if e1000_up() fails, leading to memory leaks. Refactor the code to fix this issue. Signed-off-by: Wenwen Wang --- drivers/net/ethernet/intel/e1000/e1000_ethtool.c | 7 +++ 1 file changed, 3 insert

[PATCH] net: ixgbe: fix memory leaks

2019-08-11 Thread Wenwen Wang
, the allocated 'jump', 'input', and 'mask' are not deallocated on this execution path, leading to memory leaks. Signed-off-by: Wenwen Wang --- drivers/net/ethernet/intel/ixgbe/ixgbe_main.c | 4 1 file changed, 4 insertions(+) diff --git a/drivers/net/ethernet/

[PATCH] i3c: master: fix a memory leak bug

2019-08-11 Thread Wenwen Wang
allocated buffer is not deallocated on this path, leading to a memory leak. To fix the above issue, free the buffer before returning the error. Signed-off-by: Wenwen Wang --- drivers/i3c/master.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/i3c/master.c b/d

[PATCH] ALSA: hda - Fix a memory leak bug

2019-08-09 Thread Wenwen Wang
In snd_hda_parse_generic_codec(), 'spec' is allocated through kzalloc(). Then, the pin widgets in 'codec' are parsed. However, if the parsing process fails, 'spec' is not deallocated, leading to a memory leak. To fix the above issue, free 'spec' before ret

[PATCH] ALSA: firewire: fix a memory leak bug

2019-08-07 Thread Wenwen Wang
, leading to a memory leak. To fix the above issue, free 'b->packets' before returning the error code. Signed-off-by: Wenwen Wang --- sound/firewire/packets-buffer.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sound/firewire/packets-buffer.c b/sound/firewire/

[PATCH] sound: fix a memory leak bug

2019-08-07 Thread Wenwen Wang
index' is not less than 0, -EBUSY is returned to indicate the error. However, 's' is not deallocated on this execution path, leading to a memory leak bug. To fix the above issue, free 's' before -EBUSY is returned. Signed-off-by: Wenwen Wang --- sound/sound_core.c | 3 ++- 1

[PATCH v3] ALSA: hiface: fix multiple memory leak bugs

2019-08-07 Thread Wenwen Wang
fails, both 'rt' and 'rt->out_urbs[i].buffer' are not deallocated, leading to memory leak bugs. Also, 'rt->out_urbs[i].buffer' is not deallocated if snd_pcm_new() fails. To fix the above issues, free 'rt' and 'rt->out_urbs[i].buffer'

Re: [PATCH v2] ALSA: pcm: fix multiple memory leak bugs

2019-08-07 Thread Wenwen Wang
On Wed, Aug 7, 2019 at 3:18 AM Takashi Iwai wrote: > > On Wed, 07 Aug 2019 09:09:59 +0200, > Wenwen Wang wrote: > > > > In hiface_pcm_init(), 'rt' is firstly allocated through kzalloc(). Later > > on, hiface_pcm_init_urb() is invoked to initialize 'rt

[PATCH v2] ALSA: pcm: fix multiple memory leak bugs

2019-08-07 Thread Wenwen Wang
fails, both 'rt' and 'rt->out_urbs[i].buffer' are not deallocated, leading to memory leak bugs. Also, 'rt->out_urbs[i].buffer' is not deallocated if snd_pcm_new() fails. To fix the above issues, free 'rt' and 'rt->out_urbs[i].buffer'. Sig

Re: [PATCH] ALSA: pcm: fix a memory leak bug

2019-08-06 Thread Wenwen Wang
On Wed, Aug 7, 2019 at 2:33 AM Takashi Iwai wrote: > > On Wed, 07 Aug 2019 08:15:17 +0200, > Wenwen Wang wrote: > > > > In hiface_pcm_init(), 'rt' is firstly allocated through kzalloc(). Later > > on, hiface_pcm_init_urb() is invoked to initialize &

[PATCH] ALSA: pcm: fix a memory leak bug

2019-08-06 Thread Wenwen Wang
e 'rt' before returning the error. Signed-off-by: Wenwen Wang --- sound/usb/hiface/pcm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/usb/hiface/pcm.c b/sound/usb/hiface/pcm.c index 14fc1e1..5dbcd0d 100644 --- a/sound/usb/hiface/pcm.c +++ b/soun

Re: [PATCH] ALSA: usb-midi: fix a memory leak bug

2019-08-06 Thread Wenwen Wang
On Wed, Aug 7, 2019 at 1:31 AM Takashi Iwai wrote: > > On Wed, 07 Aug 2019 05:22:09 +0200, > Wenwen Wang wrote: > > > > In __snd_usbmidi_create(), a MIDI streaming interface structure is > > allocated through kzalloc() and the pointer is saved to 'umidi'. Late

[PATCH] ALSA: usb-midi: fix a memory leak bug

2019-08-06 Thread Wenwen Wang
the audio quirk type. However, if the creation fails, the allocated 'umidi' is not deallocated, leading to a memory leak bug. To fix the above issue, free 'umidi' before returning the error. Signed-off-by: Wenwen Wang --- sound/usb/midi.c | 2 +- 1 file changed, 1 insertion

[PATCH] ALSA: usb-audio: fix a memory leak bug

2019-08-06 Thread Wenwen Wang
e above issue, free 'fp->chmap' before returning NULL. Signed-off-by: Wenwen Wang --- sound/usb/stream.c | 1 + 1 file changed, 1 insertion(+) diff --git a/sound/usb/stream.c b/sound/usb/stream.c index 7ee9d17..e852c7f 100644 --- a/sound/usb/stream.c +++ b/sound/usb/stream.c @@ -104

[PATCH] ALSA: usb-audio: fix a memory leak bug

2019-08-05 Thread Wenwen Wang
han 0, the allocated structure is not freed, leading to a memory leak. To fix the above issue, free 'elem' before returning the error. Signed-off-by: Wenwen Wang --- sound/usb/mixer_scarlett.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/sound/usb/mixer_sc

[PATCH] ASoC: dapm: fix a memory leak bug

2019-07-22 Thread Wenwen Wang
From: Wenwen Wang In snd_soc_dapm_new_control_unlocked(), a kernel buffer is allocated in dapm_cnew_widget() to hold the new dapm widget. Then, different actions are taken according to the id of the widget, i.e., 'w->id'. If any failure occurs during

[PATCH] test_firmware: fix a memory leak bug

2019-07-13 Thread Wenwen Wang
From: Wenwen Wang In test_firmware_init(), the buffer pointed to by the global pointer 'test_fw_config' is allocated through kzalloc(). Then, the buffer is initialized in __test_firmware_config_init(). In the case that the initialization fails, the following execution in test_fir

[PATCH v2] ALSA: usx2y: fix a double free bug

2019-04-29 Thread Wenwen Wang
ree_urb(), which frees the created urb. However, the urb is actually freed at card->private_free callback, i.e., snd_usX2Y_card_private_free(). So the free operation here leads to a double free bug. To fix the above issue, simply remove usb_free_urb(). Signed-off-by: Wenwen Wang --- sound/usb/usx2

Re: [PATCH] ALSA: usx2y: fix a memory leak bug

2019-04-28 Thread Wenwen Wang
On Mon, Apr 29, 2019 at 1:42 AM Takashi Iwai wrote: > > On Mon, 29 Apr 2019 07:50:11 +0200, > Wenwen Wang wrote: > > > > On Mon, Apr 29, 2019 at 12:36 AM Takashi Iwai wrote: > > > > > > On Sun, 28 Apr 2019 09:18:40 +0200, > > > Takashi Iwai wro

Re: [PATCH] ALSA: usx2y: fix a memory leak bug

2019-04-28 Thread Wenwen Wang
On Mon, Apr 29, 2019 at 12:36 AM Takashi Iwai wrote: > > On Sun, 28 Apr 2019 09:18:40 +0200, > Takashi Iwai wrote: > > > > On Sun, 28 Apr 2019 08:42:32 +0200, > > Wenwen Wang wrote: > > > > > > In usX2Y_In04_init(), a new urb is firstly created thro

[PATCH] ALSA: usx2y: fix a memory leak bug

2019-04-27 Thread Wenwen Wang
int in the urb by invoking usb_urb_ep_type_check(). If the check fails, the error code EINVAL will be returned. In that case, however, the created urb and the allocated buffer are not freed, leading to memory leaks. To fix the above issue, free the urb and the buffer if the check fails. Signed-off-by: Wenwen

[PATCH] ALSA: usb-audio: Fix a memory leak bug

2019-04-26 Thread Wenwen Wang
resulting in memory leaks. To fix the above issue, free all string pointers 'namelist[]' in a loop. Signed-off-by: Wenwen Wang --- sound/usb/mixer.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/sound/usb/mixer.c b/sound/usb/mixer.c index 73d7dff..53dccbf 100644 --- a/soun

Re: [PATCH] tracing: Fix a memory leak bug

2019-04-19 Thread Wenwen Wang
On Fri, Apr 19, 2019 at 9:37 PM Steven Rostedt wrote: > > On Fri, 19 Apr 2019 21:22:59 -0500 > Wenwen Wang wrote: > > > In trace_pid_write(), the buffer for trace parser is allocated through > > kmalloc() in trace_parser_get_init(). Later on, after the buffer is us

[PATCH] tracing: Fix a memory leak bug

2019-04-19 Thread Wenwen Wang
., ENOMEM. In that case, the allocated buffer will not be freed, which is a memory leak bug. To fix this issue, free the allocated buffer when an error is encountered. Signed-off-by: Wenwen Wang --- kernel/trace/trace.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/kernel

[PATCH v4] x86/PCI: fix a memory leak bug

2019-04-17 Thread Wenwen Wang
ion, if the I/O APIC is used, this table is actually not used. However, in that case, the allocated table is not freed, which is a memory leak bug. To fix this issue, free the allocated table if it is not used. Signed-off-by: Wenwen Wang Acked-by: Thomas Gleixner --- arch/x86/pci/irq.c | 1

Re: [PATCH v2] x86/PCI: fix a memory leak bug

2019-04-17 Thread Wenwen Wang
On Wed, Apr 17, 2019 at 12:58 AM Ingo Molnar wrote: > > > * Wenwen Wang wrote: > > > On Tue, Apr 16, 2019 at 3:33 PM Thomas Gleixner wrote: > > > > > > On Tue, 16 Apr 2019, Wenwen Wang wrote: > > > > > > > In pcibios_irq_init(), the PC

[PATCH v3] x86/PCI: fix a memory leak bug

2019-04-16 Thread Wenwen Wang
ion, if the I/O APIC is used, this table is actually not used. However, in that case, the allocated table is not freed, which is a memory leak bug. To fix this issue, free the allocated table if it is not used. Signed-off-by: Wenwen Wang --- arch/x86/pci/irq.c | 10 -- 1 file changed

Re: [PATCH v2] x86/PCI: fix a memory leak bug

2019-04-16 Thread Wenwen Wang
On Tue, Apr 16, 2019 at 3:33 PM Thomas Gleixner wrote: > > On Tue, 16 Apr 2019, Wenwen Wang wrote: > > > In pcibios_irq_init(), the PCI IRQ routing table 'pirq_table' is firstly > > found through pirq_find_routing_table(). If the table is not found and > > &#

[PATCH v2] x86/PCI: fix a memory leak bug

2019-04-16 Thread Wenwen Wang
ion, if the I/O APIC is used, this table is actually not used. However, in that case, the allocated table is not freed, which can lead to a memory leak bug. To fix this issue, this patch frees the allocated table if it is not used. Signed-off-by: Wenwen Wang --- arch/x86/pci/irq.c | 10 -

Re: [PATCH] x86/PCI: fix a memory leak bug

2019-04-16 Thread Wenwen Wang
On Tue, Apr 16, 2019 at 2:23 AM Ingo Molnar wrote: > > > * Wenwen Wang wrote: > > > In pcibios_irq_init(), the PCI IRQ routing table 'pirq_table' is firstly > > found through pirq_find_routing_table(). If the table is not found and > > 'CONFIG_PCI_BIO

[PATCH v2] udf: fix an uninitialized read bug and remove dead code

2019-04-15 Thread Wenwen Wang
incorrect results in the following execution. To fix this issue, this patch drops the whole code in the ifdef 'UDF_RECOVERY' region, as it is dead code. Signed-off-by: Wenwen Wang --- fs/udf/namei.c | 15 --- 1 file changed, 15 deletions(-) diff --git a/fs/udf/namei.c

Re: [PATCH] udf: fix an uninitialized read bug

2019-04-15 Thread Wenwen Wang
Thanks for your prompt reply, Jan! I will rework the patch. Best regards, Wenwen On Mon, Apr 15, 2019 at 11:05 AM Jan Kara wrote: > > On Mon 15-04-19 10:26:24, Wenwen Wang wrote: > > In udf_lookup(), the pointer 'fi' is a local variable initialized by the > > retur

[PATCH] udf: fix an uninitialized read bug

2019-04-15 Thread Wenwen Wang
incorrect results in the following execution. This patch simply initializes this local pointer to NULL. Signed-off-by: Wenwen Wang --- fs/udf/namei.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/udf/namei.c b/fs/udf/namei.c index 58cc241..9d499e1 100644 --- a/fs/udf/

[PATCH] x86/PCI: fix a memory leak bug

2019-04-15 Thread Wenwen Wang
ion, if the I/O APIC is used, this table is actually not used. However, in that case, the allocated table is not freed, which can lead to a memory leak bug. To fix this issue, this patch frees the allocated table if it is not used. Signed-off-by: Wenwen Wang --- arch/x86/pci/irq.c | 10 -

[PATCH] gdrom: fix a memory leak bug

2018-12-26 Thread Wenwen Wang
espectively. However, this buffer is not freed after it is used, which can cause a memory leak bug. This patch simply frees the buffer 'gd.cd_info' in exit_gdrom() to fix the above issue. Signed-off-by: Wenwen Wang --- drivers/cdrom/gdrom.c | 1 + 1 file changed, 1 insertion(+) diff -

[PATCH v2] misc: mic: fix a DMA pool free failure

2018-12-04 Thread Wenwen Wang
e., scif_cb_arg, to store the arguments required by the call back function. A variable 'cb_arg' is allocated in _scif_prog_signal() to pass the arguments. 'cb_arg' will be freed after dma_pool_free() in scif_prog_signal_cb(). Signed-off-by: Wenwen Wang --- drivers/misc/mic/sci

Re: [PATCH] misc: mic: fix a DMA pool free failure

2018-12-04 Thread Wenwen Wang
On Sun, Nov 4, 2018 at 8:05 PM Sudeep Dutt wrote: > > On Thu, 2018-10-18 at 14:46 -0500, Wenwen Wang wrote: > > In _scif_prog_signal(), a DMA pool is allocated if the MIC Coprocessor is > > not X100, i.e., the boolean variable 'x100' is false. This DMA pool will be

Re: [PATCH v4] drivers/vfio: Fix a redundant copy bug

2018-10-29 Thread Wenwen Wang
On Mon, Oct 29, 2018 at 4:32 PM Alex Williamson wrote: > > On Mon, 29 Oct 2018 13:56:54 -0500 > Wenwen Wang wrote: > > > Hello, > > > > Could you please apply this patch? Thanks! > > I'd like to see testing and/or review from David or Alexey since I also

  1   2   >