All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jiri Slaby <jirislaby@gmail.com>
To: "Cyrill V. Gorcunov" <gorcunov@gmail.com>
Cc: Sam Creasey <sammy@sammy.net>,
	linux-kernel-list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] SUN3/3X Lance trivial fix
Date: Tue, 06 Feb 2007 12:36:28 +0100	[thread overview]
Message-ID: <45C8683C.1070409@gmail.com> (raw)
In-Reply-To: <20070205191321.GA12839@cvg>

Cyrill V. Gorcunov napsal(a):
> This patch adds checking for allocated DVMA
> memory and granted IRQ line.
> 
> Signed-off-by: Cyrill V. Gorcunov <gorcunov@gmail.com>
> 
> ---
> 
>  drivers/net/sun3lance.c |    9 ++++++++-
>  1 files changed, 8 insertions(+), 1 deletions(-)
> 
> diff --git a/drivers/net/sun3lance.c b/drivers/net/sun3lance.c
> index c62e85d..e4c2c88 100644
> --- a/drivers/net/sun3lance.c
> +++ b/drivers/net/sun3lance.c
> @@ -336,13 +336,20 @@ static int __init lance_probe( struct net_device *dev)
>  
>  	/* XXX - leak? */
>  	MEM = dvma_malloc_align(sizeof(struct lance_memory), 0x10000);
> +	if (MEM == NULL) {
> +		printk(KERN_WARNING "SUN3 Lance couldn't allocate DVMA memory\n");
> +		return 0;
> +	}
>  
>  	lp->iobase = (volatile unsigned short *)ioaddr;
>  	dev->base_addr = (unsigned long)ioaddr; /* informational only */

But now, if it fails (and you return 0=OK state) these are not assigned and 
probably used later.

>  
>  	REGA(CSR0) = CSR0_STOP;
>  
> -	request_irq(LANCE_IRQ, lance_interrupt, IRQF_DISABLED, "SUN3 Lance", dev);
> +	if (request_irq(LANCE_IRQ, lance_interrupt, IRQF_DISABLED, "SUN3 Lance", dev) < 0) {
> +		printk(KERN_WARNING "SUN3 Lance unable to allocate IRQ\n");
> +		return 0;
> +	}
>  	dev->irq = (unsigned short)LANCE_IRQ;

Not even irq is grabbed.

Is this intended?

regards,
-- 
http://www.fi.muni.cz/~xslaby/            Jiri Slaby
faculty of informatics, masaryk university, brno, cz
e-mail: jirislaby gmail com, gpg pubkey fingerprint:
B674 9967 0407 CE62 ACC8  22A0 32CC 55C3 39D4 7A7E

  parent reply	other threads:[~2007-02-06 11:36 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-02-05 19:13 [PATCH] SUN3/3X Lance trivial fix Cyrill V. Gorcunov
2007-02-05 20:01 ` Sam Creasey
2007-02-06 11:36 ` Jiri Slaby [this message]
2007-02-06 11:45   ` Jiri Slaby
2007-02-06 11:47     ` Jiri Slaby
2007-02-06 12:52       ` Cyrill V. Gorcunov

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=45C8683C.1070409@gmail.com \
    --to=jirislaby@gmail.com \
    --cc=gorcunov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sammy@sammy.net \
    /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.