--- zzzz-none-000/linux-3.10.107/drivers/mtd/nand/sm_common.c 2017-06-27 09:49:32.000000000 +0000 +++ scorpion-7490-727/linux-3.10.107/drivers/mtd/nand/sm_common.c 2021-02-04 17:41:59.000000000 +0000 @@ -42,7 +42,7 @@ { struct mtd_oob_ops ops; struct sm_oob oob; - int ret, error = 0; + int ret; memset(&oob, -1, SM_OOB_SIZE); oob.block_status = 0x0F; @@ -61,11 +61,10 @@ printk(KERN_NOTICE "sm_common: can't mark sector at %i as bad\n", (int)ofs); - error = -EIO; - } else - mtd->ecc_stats.badblocks++; + return -EIO; + } - return error; + return 0; } static struct nand_flash_dev nand_smartmedia_flash_ids[] = {