Skip to content

mtd: cleanups and small bug fixes for init_msp_flash()

Jesper Juhl linux-mtd 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest4 patches 3 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4mtd: Don't cast kmalloc() return value in drivers/mtd/maps/pmcmsp-flash.cdrivers/mtd/maps/pmcmsp-flash.c+5 -83 replies
2/4mtd: convert some kmalloc()+memset() calls to kcalloc() in drivers/mtd/maps/pmcmsp-flash.cdrivers/mtd/maps/pmcmsp-flash.c+2 -40 replies
3/4mtd: Fix a potential NULL ptr deref bug and mem leak in init_msp_flash()drivers/mtd/maps/pmcmsp-flash.c+8 -40 replies
4/4mtd: Check for allocation failures and bail out appropriately in init_msp_flash()drivers/mtd/maps/pmcmsp-flash.c+17 -20 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/4] mtd: cleanups and small bug fixes for init_msp_flash()

Hi,

Here's a small series of patches to do a little cleanup + bug fixing in drivers/mtd/maps/pmcmsp-flash.c::init_msp_flash().

The patches in this series are

[PATCH 1/4] mtd: Don't cast kmalloc() return value in drivers/mtd/maps/pmcmsp-flash.c [PATCH 2/4] mtd: convert some kmalloc()+memset() calls to kcalloc() in drivers/mtd/maps/pmcmsp-flash.c [PATCH 3/4] mtd: Fix a potential NULL ptr deref bug and mem leak in init_msp_flash() [PATCH 4/4] mtd: Check for allocation failures and bail out appropriately in init_msp_flash()

Some of the patches touch the same line of code multiple times, but they are split this way to
a) to keep logical changes seperate and
b) to make the patch series 'git bisect' friendly

There's still more that could be done to this function, such as rolling back mem allocations for devices already initialized in case a subsequent one fails or similar, but that will have to wait. This is all I have time for at the moment.

Please consider merging :-)

Kind regards,
Jesper Juhl <[email protected]>