The patch titled mtd-sst25l-non-jedec-spi-flash-driver-fix has been added to the -mm tree. Its filename is mtd-sst25l-non-jedec-spi-flash-driver-fix.patch Before you just go and hit "reply", please: a) Consider who else should be cc'ed b) Prefer to cc a suitable mailing list as well c) Ideally: find the original patch on the mailing list and do a reply-to-all to that, adding suitable additional cc's *** Remember to use Documentation/SubmitChecklist when testing your code *** See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find out what to do about this The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/ ------------------------------------------------------ Subject: mtd-sst25l-non-jedec-spi-flash-driver-fix From: Ryan Mallon <ryan@xxxxxxxxxxxxxxxx> Cc: "H Hartley Sweeten" <hartleys@xxxxxxxxxxxxxxxxxxx> Cc: Andre Renaud <andre@xxxxxxxxxxxxxxxx> Cc: Anton Vorontsov <avorontsov@xxxxxxxxxxxxx> Cc: David Woodhouse <dwmw2@xxxxxxxxxxxxx> Cc: Linus Walleij <linus.walleij@xxxxxxxxxxxxxx> Signed-off-by: Ryan Mallon <ryan@xxxxxxxxxxxxxxxx> Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx> --- drivers/mtd/devices/sst25l.c | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff -puN drivers/mtd/devices/sst25l.c~mtd-sst25l-non-jedec-spi-flash-driver-fix drivers/mtd/devices/sst25l.c --- a/drivers/mtd/devices/sst25l.c~mtd-sst25l-non-jedec-spi-flash-driver-fix +++ a/drivers/mtd/devices/sst25l.c @@ -298,7 +298,7 @@ static int sst25l_write(struct mtd_info * Write the remaining bytes using auto address * increment mode */ - bytes = min(mtd->writesize, (u32)(len - i)); + bytes = min_t(u32, mtd->writesize, len - i); for (j = 1; j < bytes; j++, copied++) { ret = sst25l_wait_till_ready(flash); if (ret) @@ -367,7 +367,7 @@ static int __init sst25l_probe(struct sp struct flash_info *flash_info; struct sst25l_flash *flash; struct flash_platform_data *data; - int i; + int ret, i; flash_info = sst25l_match_device(spi); if (!flash_info) @@ -457,7 +457,14 @@ static int __init sst25l_probe(struct sp data->nr_parts, data->name); } - return add_mtd_device(&flash->mtd) == 1 ? -ENODEV : 0; + ret = add_mtd_device(&flash->mtd); + if (ret == 1) { + kfree(flash); + dev_set_drvdata(&spi->dev, NULL); + return -ENODEV; + } + + return 0; } static int __exit sst25l_remove(struct spi_device *spi) _ Patches currently in -mm which might be from ryan@xxxxxxxxxxxxxxxx are origin.patch mtd-sst25l-non-jedec-spi-flash-driver.patch mtd-sst25l-non-jedec-spi-flash-driver-update.patch mtd-sst25l-non-jedec-spi-flash-driver-fix.patch -- To unsubscribe from this list: send the line "unsubscribe mm-commits" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html