Skip to content
Unverified Commit 313aca5a authored by Wenwen Wang's avatar Wenwen Wang Committed by Tudor Ambarus
Browse files

mtd: spi-nor: fix a memory leak bug



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.

Fixes: 816873ea ("mtd: spi-nor: parse SFDP 4-byte Address Instruction Table")
Signed-off-by: default avatarWenwen Wang <wenwen@cs.uga.edu>
Signed-off-by: default avatarTudor Ambarus <tudor.ambarus@microchip.com>
parent 3e9e38d9
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment