All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: Kiran Padwal <kiran.padwal@smartplayin.com>
Cc: Russell King <linux@arm.linux.org.uk>,
	Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
	linux-fbdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Kiran Padwal <kiran.padwal21@gmail.com>
Subject: Re: [PATCH] video: ARM CLCD: Add missing error check for devm_kzalloc
Date: Fri, 20 Feb 2015 12:12:12 +0000	[thread overview]
Message-ID: <54E7249C.8050006@ti.com> (raw)
In-Reply-To: <1423647406-858-1-git-send-email-kiran.padwal@smartplayin.com>

[-- Attachment #1: Type: text/plain, Size: 909 bytes --]

On 11/02/15 11:36, Kiran Padwal wrote:
> This patch add a missing check on the return value of devm_kzalloc,
> which would cause a NULL pointer dereference in a OOM situation.
> 
> Signed-off-by: Kiran Padwal <kiran.padwal@smartplayin.com>
> ---
>  drivers/video/fbdev/amba-clcd.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/video/fbdev/amba-clcd.c b/drivers/video/fbdev/amba-clcd.c
> index 32c0b6b..9362424 100644
> --- a/drivers/video/fbdev/amba-clcd.c
> +++ b/drivers/video/fbdev/amba-clcd.c
> @@ -599,6 +599,9 @@ static int clcdfb_of_get_mode(struct device *dev, struct device_node *endpoint,
>  
>  	len = clcdfb_snprintf_mode(NULL, 0, mode);
>  	name = devm_kzalloc(dev, len + 1, GFP_KERNEL);
> +	if (!name)
> +		return -ENOMEM;
> +
>  	clcdfb_snprintf_mode(name, len + 1, mode);
>  	mode->name = name;
>  
> 

Thanks, queued for 3.20.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

WARNING: multiple messages have this Message-ID (diff)
From: Tomi Valkeinen <tomi.valkeinen@ti.com>
To: Kiran Padwal <kiran.padwal@smartplayin.com>
Cc: Russell King <linux@arm.linux.org.uk>,
	Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
	<linux-fbdev@vger.kernel.org>, <linux-kernel@vger.kernel.org>,
	Kiran Padwal <kiran.padwal21@gmail.com>
Subject: Re: [PATCH] video: ARM CLCD: Add missing error check for devm_kzalloc
Date: Fri, 20 Feb 2015 14:12:12 +0200	[thread overview]
Message-ID: <54E7249C.8050006@ti.com> (raw)
In-Reply-To: <1423647406-858-1-git-send-email-kiran.padwal@smartplayin.com>

[-- Attachment #1: Type: text/plain, Size: 909 bytes --]

On 11/02/15 11:36, Kiran Padwal wrote:
> This patch add a missing check on the return value of devm_kzalloc,
> which would cause a NULL pointer dereference in a OOM situation.
> 
> Signed-off-by: Kiran Padwal <kiran.padwal@smartplayin.com>
> ---
>  drivers/video/fbdev/amba-clcd.c |    3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/drivers/video/fbdev/amba-clcd.c b/drivers/video/fbdev/amba-clcd.c
> index 32c0b6b..9362424 100644
> --- a/drivers/video/fbdev/amba-clcd.c
> +++ b/drivers/video/fbdev/amba-clcd.c
> @@ -599,6 +599,9 @@ static int clcdfb_of_get_mode(struct device *dev, struct device_node *endpoint,
>  
>  	len = clcdfb_snprintf_mode(NULL, 0, mode);
>  	name = devm_kzalloc(dev, len + 1, GFP_KERNEL);
> +	if (!name)
> +		return -ENOMEM;
> +
>  	clcdfb_snprintf_mode(name, len + 1, mode);
>  	mode->name = name;
>  
> 

Thanks, queued for 3.20.

 Tomi



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

  reply	other threads:[~2015-02-20 12:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-02-11  9:36 [PATCH] video: ARM CLCD: Add missing error check for devm_kzalloc Kiran Padwal
2015-02-11  9:48 ` Kiran Padwal
2015-02-20 12:12 ` Tomi Valkeinen [this message]
2015-02-20 12:12   ` Tomi Valkeinen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=54E7249C.8050006@ti.com \
    --to=tomi.valkeinen@ti.com \
    --cc=kiran.padwal21@gmail.com \
    --cc=kiran.padwal@smartplayin.com \
    --cc=linux-fbdev@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@arm.linux.org.uk \
    --cc=plagnioj@jcrosoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.