From: Sergei Shtylyov <sshtylyov@mvista.com>
To: linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] arm: mach-omap2: potential NULL dereference
Date: Mon, 17 Jan 2011 12:30:56 +0000 [thread overview]
Message-ID: <4D343680.1030701@ru.mvista.com> (raw)
In-Reply-To: <1295258922-31242-1-git-send-email-segoon@openwall.com>
Hello.
On 17-01-2011 13:08, Vasiliy Kulikov wrote:
> kzalloc() may fail, if so return -ENOMEM.
> Signed-off-by: Vasiliy Kulikov<segoon@openwall.com>
[...]
> diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
> index 77ecebf..871bca9 100644
> --- a/arch/arm/mach-omap2/smartreflex.c
> +++ b/arch/arm/mach-omap2/smartreflex.c
> @@ -260,7 +260,10 @@ static int sr_late_init(struct omap_sr *sr_info)
> if (sr_class->class_type = SR_CLASS2&&
> sr_class->notify_flags&& sr_info->irq) {
>
> + ret = -ENOMEM;
> name = kzalloc(SMARTREFLEX_NAME_LEN + 1, GFP_KERNEL);
> + if (name = NULL)
> + goto error;
Why not:
if (name = NULL) {
ret = -ENOMEM;
goto error;
}
WBR, Sergei
WARNING: multiple messages have this Message-ID (diff)
From: Sergei Shtylyov <sshtylyov@mvista.com>
To: Vasiliy Kulikov <segoon@openwall.com>
Cc: kernel-janitors@vger.kernel.org, Tony Lindgren <tony@atomide.com>,
linux-omap@vger.kernel.org, Russell King <linux@arm.linux.org.uk>,
linux-kernel@vger.kernel.org,
linux-arm-kernel@lists.infradead.org
Subject: Re: [PATCH] arm: mach-omap2: potential NULL dereference
Date: Mon, 17 Jan 2011 15:30:56 +0300 [thread overview]
Message-ID: <4D343680.1030701@ru.mvista.com> (raw)
In-Reply-To: <1295258922-31242-1-git-send-email-segoon@openwall.com>
Hello.
On 17-01-2011 13:08, Vasiliy Kulikov wrote:
> kzalloc() may fail, if so return -ENOMEM.
> Signed-off-by: Vasiliy Kulikov<segoon@openwall.com>
[...]
> diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
> index 77ecebf..871bca9 100644
> --- a/arch/arm/mach-omap2/smartreflex.c
> +++ b/arch/arm/mach-omap2/smartreflex.c
> @@ -260,7 +260,10 @@ static int sr_late_init(struct omap_sr *sr_info)
> if (sr_class->class_type == SR_CLASS2&&
> sr_class->notify_flags&& sr_info->irq) {
>
> + ret = -ENOMEM;
> name = kzalloc(SMARTREFLEX_NAME_LEN + 1, GFP_KERNEL);
> + if (name == NULL)
> + goto error;
Why not:
if (name == NULL) {
ret = -ENOMEM;
goto error;
}
WBR, Sergei
WARNING: multiple messages have this Message-ID (diff)
From: sshtylyov@mvista.com (Sergei Shtylyov)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH] arm: mach-omap2: potential NULL dereference
Date: Mon, 17 Jan 2011 15:30:56 +0300 [thread overview]
Message-ID: <4D343680.1030701@ru.mvista.com> (raw)
In-Reply-To: <1295258922-31242-1-git-send-email-segoon@openwall.com>
Hello.
On 17-01-2011 13:08, Vasiliy Kulikov wrote:
> kzalloc() may fail, if so return -ENOMEM.
> Signed-off-by: Vasiliy Kulikov<segoon@openwall.com>
[...]
> diff --git a/arch/arm/mach-omap2/smartreflex.c b/arch/arm/mach-omap2/smartreflex.c
> index 77ecebf..871bca9 100644
> --- a/arch/arm/mach-omap2/smartreflex.c
> +++ b/arch/arm/mach-omap2/smartreflex.c
> @@ -260,7 +260,10 @@ static int sr_late_init(struct omap_sr *sr_info)
> if (sr_class->class_type == SR_CLASS2&&
> sr_class->notify_flags&& sr_info->irq) {
>
> + ret = -ENOMEM;
> name = kzalloc(SMARTREFLEX_NAME_LEN + 1, GFP_KERNEL);
> + if (name == NULL)
> + goto error;
Why not:
if (name == NULL) {
ret = -ENOMEM;
goto error;
}
WBR, Sergei
next prev parent reply other threads:[~2011-01-17 12:30 UTC|newest]
Thread overview: 18+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-01-17 10:08 [PATCH] arm: mach-omap2: potential NULL dereference Vasiliy Kulikov
2011-01-17 10:08 ` Vasiliy Kulikov
2011-01-17 10:08 ` Vasiliy Kulikov
2011-01-17 10:08 ` Vasiliy Kulikov
2011-01-17 10:08 ` Vasiliy Kulikov
2011-01-17 10:08 ` Vasiliy Kulikov
2011-01-17 10:38 ` walter harms
2011-01-17 10:38 ` walter harms
2011-01-17 10:38 ` walter harms
2011-01-19 12:57 ` [PATCH v2] " Vasiliy Kulikov
2011-01-19 12:57 ` Vasiliy Kulikov
2011-01-19 12:57 ` Vasiliy Kulikov
2011-02-01 22:22 ` Kevin Hilman
2011-02-01 22:22 ` Kevin Hilman
2011-02-01 22:22 ` Kevin Hilman
2011-01-17 12:30 ` Sergei Shtylyov [this message]
2011-01-17 12:30 ` [PATCH] " Sergei Shtylyov
2011-01-17 12:30 ` Sergei Shtylyov
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=4D343680.1030701@ru.mvista.com \
--to=sshtylyov@mvista.com \
--cc=linux-arm-kernel@lists.infradead.org \
/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.