mbox series

[v2,0/2] meson-nand: two small memory related fixes

Message ID 20190318204722.9901-1-martin.blumenstingl@googlemail.com (mailing list archive)
Headers show
Series meson-nand: two small memory related fixes | expand

Message

Martin Blumenstingl March 18, 2019, 8:47 p.m. UTC
While trying to add support for older Meson SoCs to the meson-nand
driver I was experiencing a crash in meson_nfc_read_buf(). While trying
to find out why that happened I inspected the code in that function and
found that there's:
- a missing check on the return value of a kzalloc() call
- a potential memory leak in it

Both fixes have nothing to do with my original crash (for which I'll
open a separate thread).


Changes since v1:
- collected Liang's Acked-by's (thank you!)
- rebased on top of v5.1-rc1


Martin Blumenstingl (2):
  mtd: rawnand: meson: add missing ENOMEM check in meson_nfc_read_buf()
  mtd: rawnand: meson: fix a potential memory leak in meson_nfc_read_buf

 drivers/mtd/nand/raw/meson_nand.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

Comments

Miquel Raynal April 1, 2019, 3:27 p.m. UTC | #1
Hi Martin,

Martin Blumenstingl <martin.blumenstingl@googlemail.com> wrote on Mon,
18 Mar 2019 21:47:20 +0100:

> While trying to add support for older Meson SoCs to the meson-nand
> driver I was experiencing a crash in meson_nfc_read_buf(). While trying
> to find out why that happened I inspected the code in that function and
> found that there's:
> - a missing check on the return value of a kzalloc() call
> - a potential memory leak in it
> 
> Both fixes have nothing to do with my original crash (for which I'll
> open a separate thread).
> 
> 
> Changes since v1:
> - collected Liang's Acked-by's (thank you!)
> - rebased on top of v5.1-rc1
> 
> 
> Martin Blumenstingl (2):
>   mtd: rawnand: meson: add missing ENOMEM check in meson_nfc_read_buf()
>   mtd: rawnand: meson: fix a potential memory leak in meson_nfc_read_buf
> 
>  drivers/mtd/nand/raw/meson_nand.c | 7 ++++++-
>  1 file changed, 6 insertions(+), 1 deletion(-)
> 


Applied to git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux.git
on nand/next.


Thanks,
Miquèl