linux-mtd.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] mtd: nandsim: fix error handling
@ 2015-06-17  8:45 Sheng Yong
  2015-06-17  8:45 ` [PATCH 1/2] mtd: nandsim: fix free of NULL pointer Sheng Yong
                   ` (3 more replies)
  0 siblings, 4 replies; 11+ messages in thread
From: Sheng Yong @ 2015-06-17  8:45 UTC (permalink / raw)
  To: computersforpeace, dwmw2; +Cc: richard, linux-mtd

These 2 patches fix error handling when nandsim initialization fails.

In alloc_device(), if creating slab memory fails, free_device() will try
to destroy the slab memory without checking if it exists.  PATCH 1 fixes
it.

If something goes wrong in init_nandsim(), it calls free_device() before
returning. However, the caller of init_nandsim() - ns_init_module() - also
does the cleanup by calling free_nandsim(). This causes double free. PATCH
2 fixes it.

Thanks,
Sheng

Sheng Yong (2):
  mtd: nandsim: fix free of NULL pointer
  mtd: nandsim: fix double free

 drivers/mtd/nand/nandsim.c | 22 +++++++---------------
 1 file changed, 7 insertions(+), 15 deletions(-)

-- 
1.8.3.4

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2015-06-24  0:54 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-06-17  8:45 [PATCH 0/2] mtd: nandsim: fix error handling Sheng Yong
2015-06-17  8:45 ` [PATCH 1/2] mtd: nandsim: fix free of NULL pointer Sheng Yong
2015-06-17  8:48   ` Richard Weinberger
2015-06-17  9:00     ` Richard Weinberger
2015-06-17  9:03     ` Sheng Yong
2015-06-17  9:05       ` Richard Weinberger
2015-06-17  8:45 ` [PATCH 2/2] mtd: nandsim: fix double free Sheng Yong
2015-06-23  1:03 ` [PATCH 0/2] mtd: nandsim: fix error handling Sheng Yong
2015-06-23  6:26   ` Richard Weinberger
2015-06-24  0:53     ` Sheng Yong
2015-06-23 21:59 ` Brian Norris

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).