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() > > fails, leading to a memory leak. To fix this

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

2019-08-19 Thread Tudor.Ambarus
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() > fails, leading to a memory leak. To fix this issue, free 'dwords' before > returning the error.

[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 ---