Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

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

Pull MTD fixes from Brian Norris:
- fix a small memory leak in some new ONFI code
- account for additional odd variations of Micron SPI flash

Acked by David Woodhouse.

* tag 'for-linus-20131008' of git://git.infradead.org/linux-mtd:
mtd: m25p80: Fix 4 byte addressing mode for Micron devices.
mtd: nand: fix memory leak in ONFI extended parameter page

+18 -7
+15 -2
drivers/mtd/devices/m25p80.c
··· 168 168 */ 169 169 static inline int set_4byte(struct m25p *flash, u32 jedec_id, int enable) 170 170 { 171 + int status; 172 + bool need_wren = false; 173 + 171 174 switch (JEDEC_MFR(jedec_id)) { 172 - case CFI_MFR_MACRONIX: 173 175 case CFI_MFR_ST: /* Micron, actually */ 176 + /* Some Micron need WREN command; all will accept it */ 177 + need_wren = true; 178 + case CFI_MFR_MACRONIX: 174 179 case 0xEF /* winbond */: 180 + if (need_wren) 181 + write_enable(flash); 182 + 175 183 flash->command[0] = enable ? OPCODE_EN4B : OPCODE_EX4B; 176 - return spi_write(flash->spi, flash->command, 1); 184 + status = spi_write(flash->spi, flash->command, 1); 185 + 186 + if (need_wren) 187 + write_disable(flash); 188 + 189 + return status; 177 190 default: 178 191 /* Spansion style */ 179 192 flash->command[0] = OPCODE_BRWR;
+3 -5
drivers/mtd/nand/nand_base.c
··· 2869 2869 2870 2870 len = le16_to_cpu(p->ext_param_page_length) * 16; 2871 2871 ep = kmalloc(len, GFP_KERNEL); 2872 - if (!ep) { 2873 - ret = -ENOMEM; 2874 - goto ext_out; 2875 - } 2872 + if (!ep) 2873 + return -ENOMEM; 2876 2874 2877 2875 /* Send our own NAND_CMD_PARAM. */ 2878 2876 chip->cmdfunc(mtd, NAND_CMD_PARAM, 0, -1); ··· 2918 2920 } 2919 2921 2920 2922 pr_info("ONFI extended param page detected.\n"); 2921 - return 0; 2923 + ret = 0; 2922 2924 2923 2925 ext_out: 2924 2926 kfree(ep);