public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andrew Morton <akpm@linux-foundation.org>
To: The AmigaLinux A2232 Driver Project <A2232@gmx.net>
Cc: Linus Torvalds <torvalds@linux-foundation.org>,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] ser_a2232.c bug removed: handles "IRQ request denied" case
Date: Mon, 10 Sep 2007 02:32:05 -0700	[thread overview]
Message-ID: <20070910023205.d7aaefc7.akpm@linux-foundation.org> (raw)
In-Reply-To: <Pine.LNX.4.64.0708301609120.21063@haneman.hacenet>

On Thu, 30 Aug 2007 16:13:55 +0100 (BST) The AmigaLinux A2232 Driver Project <A2232@gmx.net> wrote:

> 
> 
> This patch handles the case in which the request for the
> vertical blank interrupt could not be granted. Thanks to
> Nazia Zaman for spotting it.
> 
> Applies to latest 2.6.x kernels.
> 
> 
> --- linux/drivers/char/ser_a2232.c.org	2007-08-30 15:41:25.000000000 +0100
> +++ linux/drivers/char/ser_a2232.c	2007-08-30 15:46:17.000000000 +0100
> @@ -787,7 +787,7 @@ static int __init a2232board_init(void)
> 
>   	}
> 
> -	printk("Total: %d A2232 boards initialized.\n", nr_a2232); /* Some status report if no card was found */
> +	printk("Total: %d A2232 boards detected.\n", nr_a2232); /* Some status report if no card was found */
> 
>   	a2232_init_portstructs();
> 
> @@ -795,9 +795,13 @@ static int __init a2232board_init(void)
>   		a2232_init_drivers also registers the drivers. Must be here because all boards
>   		have to be detected first.
>   	*/
> -	if (a2232_init_drivers()) return -ENODEV; // maybe we should use a different -Exxx?
> +	if (a2232_init_drivers())
> +		return -ENODEV; // maybe we should use a different -Exxx?
> 
> -	request_irq(IRQ_AMIGA_VERTB, a2232_vbl_inter, 0, "A2232 serial VBL", a2232_driver_ID);
> +	if (request_irq(IRQ_AMIGA_VERTB, a2232_vbl_inter, 0, "A2232 serial VBL", a2232_driver_ID))
> +		return -ENODEV;

We're going to need to undo the things which a2232_init_drivers() just did.
There's a memory leak and the registered tty driver might even cause a
crash if someone tries to use it?

Perhaps requesting the IRQ before running a2232_init_drivers() would be a
suitable approach.


> +	printk("A2232 driver initialized successfully.\n");
>   	return 0;
>   }
> 



  reply	other threads:[~2007-09-10  9:32 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-08-30 15:13 [PATCH] ser_a2232.c bug removed: handles "IRQ request denied" case The AmigaLinux A2232 Driver Project
2007-09-10  9:32 ` Andrew Morton [this message]
2007-11-05 18:57   ` Enver Haase

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=20070910023205.d7aaefc7.akpm@linux-foundation.org \
    --to=akpm@linux-foundation.org \
    --cc=A2232@gmx.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=torvalds@linux-foundation.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