History

Merge tag 'for-linus-20160415' of git://git.infradead.org/linux-mtd

Pull MTD fix from Brian Norris: "One MTD fix for v4.6-rc4: In the v4.4 cycle, we relaxed the requirement for assigning mtd->owner, but we didn't remove this error case. It's hit only by drivers that are both: (a) using nand_scan() directly and (b) built as modules We haven't seen explicit complaints about this (most use cases don't fit one or both of the above), but we should definitely not be BUG()'ing here" * tag 'for-linus-20160415' of git://git.infradead.org/linux-mtd: mtd: nand: Drop mtd.owner requirement in nand_scan

Linus Torvalds committed 10 years ago

Commit 29dde7c2 parents 2fffad1 20c07a51 file · +1 −9Browse files

Unified · Split

drivers/mtd/nand/nand_base.c+1−9
@@ -4009,7 +4009,6 @@ static int nand_dt_init(struct nand_chip *chip) · 4008 unmodified lines
4009 * This is the first phase of the normal nand_scan() function. It reads the4009 * This is the first phase of the normal nand_scan() function. It reads the
4010 * flash ID and sets up MTD fields accordingly.4010 * flash ID and sets up MTD fields accordingly.
4011 *4011 *
4012 * The mtd->owner field must be set to the module of the caller.
4013 */4012 */
4014int nand_scan_ident(struct mtd_info *mtd, int maxchips,4013int nand_scan_ident(struct mtd_info *mtd, int maxchips,
4015 struct nand_flash_dev *table)4014 struct nand_flash_dev *table)
@@ -4429,19 +4428,12 @@ EXPORT_SYMBOL(nand_scan_tail); · 413 unmodified lines
4429 *4428 *
4430 * This fills out all the uninitialized function pointers with the defaults.4429 * This fills out all the uninitialized function pointers with the defaults.
4431 * The flash ID is read and the mtd/chip structures are filled with the4430 * The flash ID is read and the mtd/chip structures are filled with the
4432 * appropriate values. The mtd->owner field must be set to the module of the4431 * appropriate values.
4433 * caller.
4434 */4432 */
4435int nand_scan(struct mtd_info *mtd, int maxchips)4433int nand_scan(struct mtd_info *mtd, int maxchips)
4436{4434{
4437 int ret;4435 int ret;
4438 4436
4439 /* Many callers got this wrong, so check for it for a while... */
4440 if (!mtd->owner && caller_is_module()) {
4441 pr_crit("%s called with NULL mtd->owner!\n", __func__);
4442 BUG();
4443 }
4444
4445 ret = nand_scan_ident(mtd, maxchips, NULL);4437 ret = nand_scan_ident(mtd, maxchips, NULL);
4446 if (!ret)4438 if (!ret)
4447 ret = nand_scan_tail(mtd);4439 ret = nand_scan_tail(mtd);