Re: [PATCH] mtd: diskonchip: mem resource name is not optional

From: Alexander Shiyan
Date: Sat Mar 22 2014 - 04:40:37 EST


Wed, 19 Mar 2014 18:24:37 -0400 ÐÑ Sasha Levin <sasha.levin@xxxxxxxxxx>:
> Passing a name to request_mem_region() isn't optional and can't just
> be NULL. Passing NULL causes a NULL ptr deref later in the boot
> process.
>
> Signed-off-by: Sasha Levin <sasha.levin@xxxxxxxxxx>
> ---
> drivers/mtd/nand/diskonchip.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/mtd/nand/diskonchip.c b/drivers/mtd/nand/diskonchip.c
> index b9b4db6..f68a7bc 100644
> --- a/drivers/mtd/nand/diskonchip.c
> +++ b/drivers/mtd/nand/diskonchip.c
> @@ -1439,7 +1439,7 @@ static int __init doc_probe(unsigned long physadr)
> int reg, len, numchips;
> int ret = 0;
>
> - if (!request_mem_region(physadr, DOC_IOREMAP_LEN, NULL))
> + if (!request_mem_region(physadr, DOC_IOREMAP_LEN, "DiskOnChip"))
> return -EBUSY;
> virtadr = ioremap(physadr, DOC_IOREMAP_LEN);
> if (!virtadr) {
> --

Tested-by: Alexander Shiyan <shc_work@xxxxxxx>

---

N‹§²æ¸›yú²X¬¶ÇvØ–)Þ{.nlj·¥Š{±‘êX§¶›¡Ü}©ž²ÆzÚj:+v‰¨¾«‘êZ+€Êzf£¢·hšˆ§~†­†Ûÿû®w¥¢¸?™¨è&¢)ßf”ùy§m…á«a¶Úÿ 0¶ìå