Re: [PATCH] mtd: atmel_nand: fix null pointer dereference

2014-09-03 Thread Sascha Hauer
On Tue, Sep 02, 2014 at 09:04:48PM +0200, Raphaël Poggi wrote:
 I think this patch could be squash in [PATCH v3 3/3] mtd: atmel_nand:
 add support for device tree

Did that, thanks.

Sascha

-- 
Pengutronix e.K.   | |
Industrial Linux Solutions | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0|
Amtsgericht Hildesheim, HRA 2686   | Fax:   +49-5121-206917- |

___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox


Re: [PATCH] mtd: atmel_nand: fix null pointer dereference

2014-09-02 Thread Raphaël Poggi
I think this patch could be squash in [PATCH v3 3/3] mtd: atmel_nand:
add support for device tree

2014-09-02 21:02 GMT+02:00 Raphaël Poggi poggi.r...@gmail.com:
 We need to allocate pdata for device tree and non device tree probe.
 In device tree probe we use pdata to fill structure member with dts data.
 In non device tree probe we use the pdata to handle platform_data.

 Signed-off-by: Raphaël Poggi poggi.r...@gmail.com
 ---
  drivers/mtd/nand/atmel_nand.c | 8 
  1 file changed, 4 insertions(+), 4 deletions(-)

 diff --git a/drivers/mtd/nand/atmel_nand.c b/drivers/mtd/nand/atmel_nand.c
 index 910ecc3..1e7c6c6 100644
 --- a/drivers/mtd/nand/atmel_nand.c
 +++ b/drivers/mtd/nand/atmel_nand.c
 @@ -1194,6 +1194,10 @@ static int __init atmel_nand_probe(struct device_d 
 *dev)
 if (!host)
 return -ENOMEM;

 +   pdata = kzalloc(sizeof(struct atmel_nand_data), GFP_KERNEL);
 +   if (!pdata)
 +   return -ENOMEM;
 +
 host-io_base = dev_request_mem_region(dev, 0);

 mtd = host-mtd;
 @@ -1206,10 +1210,6 @@ static int __init atmel_nand_probe(struct device_d 
 *dev)
 if (res)
 goto err_no_card;
 } else {
 -   pdata = kzalloc(sizeof(struct atmel_nand_data), GFP_KERNEL);
 -   if (!pdata)
 -   return -ENOMEM;
 -
 memcpy(host-board, dev-platform_data, sizeof(struct 
 atmel_nand_data));
 }

 --
 1.8.3.2


___
barebox mailing list
barebox@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox