Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 176941
b: refs/heads/master
c: 61c3506
h: refs/heads/master
i:
  176939: 8a6170e
v: v3
  • Loading branch information
Johannes Stezenbach authored and David Woodhouse committed Nov 30, 2009
1 parent 2ef446b commit f63f96e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 74218fedf478323cce831b51507eebd1faf0bf7f
refs/heads/master: 61c3506c2cabe58bcdfe438d1e57b62994db1616
11 changes: 9 additions & 2 deletions trunk/drivers/mtd/devices/m25p80.c
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ struct m25p {
struct mtd_info mtd;
unsigned partitioned:1;
u8 erase_opcode;
u8 command[CMD_SIZE + FAST_READ_DUMMY_BYTE];
u8 *command;
};

static inline struct m25p *mtd_to_m25p(struct mtd_info *mtd)
Expand Down Expand Up @@ -769,6 +769,11 @@ static int __devinit m25p_probe(struct spi_device *spi)
flash = kzalloc(sizeof *flash, GFP_KERNEL);
if (!flash)
return -ENOMEM;
flash->command = kmalloc(CMD_SIZE + FAST_READ_DUMMY_BYTE, GFP_KERNEL);
if (!flash->command) {
kfree(flash);
return -ENOMEM;
}

flash->spi = spi;
mutex_init(&flash->lock);
Expand Down Expand Up @@ -888,8 +893,10 @@ static int __devexit m25p_remove(struct spi_device *spi)
status = del_mtd_partitions(&flash->mtd);
else
status = del_mtd_device(&flash->mtd);
if (status == 0)
if (status == 0) {
kfree(flash->command);
kfree(flash);
}
return 0;
}

Expand Down

0 comments on commit f63f96e

Please sign in to comment.