All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexey Dobriyan <adobriyan@gmail.com>
To: kernel-janitors@vger.kernel.org
Subject: Re: [KJ] [PATCH] Audit return code :
Date: Tue, 21 Jun 2005 19:32:04 +0000	[thread overview]
Message-ID: <200506212332.04474.adobriyan@gmail.com> (raw)
In-Reply-To: <20050621101842.GI4880@rhum.iomeda.fr>

On Tuesday 21 June 2005 14:18, Christophe Lucas wrote:
> Audit return codes (and handle failure correctly) for misc_register.

> --- 2.6.12-orig/drivers/misc/hdpuftrs/hdpu_cpustate.c
> +++ 2.6.12/drivers/misc/hdpuftrs/hdpu_cpustate.c
> @@ -192,12 +192,19 @@ static int hdpu_cpustate_probe(struct de
>  {
>  	struct platform_device *pdev = to_platform_device(ddev);
>  	struct resource *res;
> +	int ret;
>  
>  	res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
>  	cpustate.set_addr = (unsigned long *)res->start;
>  	cpustate.clr_addr = (unsigned long *)res->end - 1;
>  
> -	misc_register(&cpustate_dev);
> +	if (ret = misc_register(&cpustate_dev)) {
> +		printk(KERN_WARNING "Unable to register misc device.\n");
> +		cpustate.set_addr = 0;
> +		cpustate.clr_addr = 0;

Why clear them? Anyway, both are pointers, so use NULL.

> +		return ret ;
> +	}
> +
>  	create_proc_read_entry("sky_cpustate", 0, 0, cpustate_read_proc, NULL);

Also unchecked.

Please, post patches inline.
_______________________________________________
Kernel-janitors mailing list
Kernel-janitors@lists.osdl.org
http://lists.osdl.org/mailman/listinfo/kernel-janitors

  reply	other threads:[~2005-06-21 19:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-06-21 10:18 [KJ] [PATCH] Audit return code : Christophe Lucas
2005-06-21 19:32 ` Alexey Dobriyan [this message]
2005-06-22  7:07 ` Christophe Lucas

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=200506212332.04474.adobriyan@gmail.com \
    --to=adobriyan@gmail.com \
    --cc=kernel-janitors@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 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.