mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Borislav Petkov <bp@amd64.org>
To: Denis Kirjanov <kirjanov@gmail.com>
Cc: linux-edac@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] check the kzalloc return value
Date: Tue, 23 Oct 2012 17:42:26 +0200	[thread overview]
Message-ID: <20121023154226.GB16140@aftab.osrc.amd.com> (raw)
In-Reply-To: <1350921364-26366-1-git-send-email-kirjanov@gmail.com>

On Mon, Oct 22, 2012 at 07:56:04PM +0400, Denis Kirjanov wrote:
> 

Needs a commit message.

> Signed-off-by: Denis Kirjanov <kirjanov@gmail.com>
> ---
>  drivers/edac/edac_mc_sysfs.c |    3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/edac/edac_mc_sysfs.c b/drivers/edac/edac_mc_sysfs.c
> index ed0bc07..55ce016 100644
> --- a/drivers/edac/edac_mc_sysfs.c
> +++ b/drivers/edac/edac_mc_sysfs.c
> @@ -1128,7 +1128,8 @@ int __init edac_mc_sysfs_init(void)
>  	}
>  
>  	mci_pdev = kzalloc(sizeof(*mci_pdev), GFP_KERNEL);
> -
> +	if (!mci_pdev)
> +		return -ENOMEM;

This either needs to do

	edac_put_sysfs_subsys();

on the error-out path.

>  	mci_pdev->bus = edac_subsys;
>  	mci_pdev->type = &mc_attr_type;
>  	device_initialize(mci_pdev);

Thanks.

-- 
Regards/Gruss,
Boris.

Advanced Micro Devices GmbH
Einsteinring 24, 85609 Dornach
GM: Alberto Bozzo
Reg: Dornach, Landkreis Muenchen
HRB Nr. 43632 WEEE Registernr: 129 19551

  reply	other threads:[~2012-10-23 15:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-10-22 15:56 Denis Kirjanov
2012-10-23 15:42 ` Borislav Petkov [this message]
2012-10-23 15:47   ` Denis Kirjanov

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=20121023154226.GB16140@aftab.osrc.amd.com \
    --to=bp@amd64.org \
    --cc=kirjanov@gmail.com \
    --cc=linux-edac@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®