diff mbox

mtd: diskonchip: mem resource name is not optional

Message ID 1395267877-15223-1-git-send-email-sasha.levin@oracle.com
State Accepted
Commit 86e4bbc766b9456f583f2fc3c4f6c623b422af88
Headers show

Commit Message

Sasha Levin March 19, 2014, 10:24 p.m. UTC
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@oracle.com>
---
 drivers/mtd/nand/diskonchip.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

Comments

Alexander Shiyan March 22, 2014, 8:39 a.m. UTC | #1
Wed, 19 Mar 2014 18:24:37 -0400 от Sasha Levin <sasha.levin@oracle.com>:
> 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@oracle.com>
> ---
>  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@mail.ru>

---
Sasha Levin March 30, 2014, 12:31 a.m. UTC | #2
On 03/22/2014 04:39 AM, Alexander Shiyan wrote:
> Wed, 19 Mar 2014 18:24:37 -0400 от Sasha Levin <sasha.levin@oracle.com>:
>> 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@oracle.com>
>> ---
>>   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@mail.ru>

It seems that no one pulled this patch anywhere. It fixes a straightforward
boot failure on boot when diskonchip is enabled in the config.

Someone grab it please?


Thanks,
Sasha
Brian Norris April 1, 2014, 1:46 a.m. UTC | #3
On Sat, Mar 29, 2014 at 08:31:52PM -0400, Sasha Levin wrote:
> On 03/22/2014 04:39 AM, Alexander Shiyan wrote:
> >Wed, 19 Mar 2014 18:24:37 -0400 от Sasha Levin <sasha.levin@oracle.com>:
> >>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@oracle.com>
> >>---
> >>  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@mail.ru>
> 
> It seems that no one pulled this patch anywhere. It fixes a straightforward
> boot failure on boot when diskonchip is enabled in the config.
> 
> Someone grab it please?

Pushed to l2-mtd.git, marked for stable >= 3.14.

Brian
diff mbox

Patch

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) {