1 From 99b1d1887fee36ef9ff5d2ee24f0cf3e8c172104 Mon Sep 17 00:00:00 2001
2 From: Hauke Mehrtens <hauke@hauke-m.de>
3 Date: Sun, 13 Oct 2013 22:53:49 +0200
4 Subject: [PATCH] mtd: bcm47xxpart: handle malloc failures
6 Handle return NULL in malloc.
8 Signed-off-by: Hauke Mehrtens <hauke@hauke-m.de>
9 Signed-off-by: Brian Norris <computersforpeace@gmail.com>
11 drivers/mtd/bcm47xxpart.c | 7 +++++++
12 1 file changed, 7 insertions(+)
14 --- a/drivers/mtd/bcm47xxpart.c
15 +++ b/drivers/mtd/bcm47xxpart.c
16 @@ -71,7 +71,14 @@ static int bcm47xxpart_parse(struct mtd_
18 parts = kzalloc(sizeof(struct mtd_partition) * BCM47XXPART_MAX_PARTS,
23 buf = kzalloc(BCM47XXPART_BYTES_TO_READ, GFP_KERNEL);
29 /* Parse block by block looking for magics */
30 for (offset = 0; offset <= master->size - blocksize;