public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Olivier Galibert <galibert@pobox.com>
To: linux-kernel@vger.kernel.org
Cc: alan@redhat.com
Subject: Re: [PATCH] isicom: Fix buffer allocation
Date: Tue, 29 Apr 2008 17:26:07 +0200	[thread overview]
Message-ID: <20080429152607.GA40409@dspnet.fr.eu.org> (raw)
In-Reply-To: <20080429141733.607a2306@core>

On Tue, Apr 29, 2008 at 02:17:33PM +0100, Alan Cox wrote:
> Fix the rather strange buffer management on open that turned up while
> auditing for BKL dependancies
> 
> Signed-off-by: Alan Cox <alan@redhat.com>
> 
> diff -u --new-file --recursive --exclude-from /usr/src/exclude linux.vanilla-2.6.25-mm1/drivers/char/isicom.c linux-2.6.25-mm1/drivers/char/isicom.c
> --- linux.vanilla-2.6.25-mm1/drivers/char/isicom.c	2008-04-28 11:36:48.000000000 +0100
> +++ linux-2.6.25-mm1/drivers/char/isicom.c	2008-04-14 10:56:25.000000000 +0100
> @@ -813,15 +813,13 @@
>  		return 0;
>  	if (!port->xmit_buf) {
>  		/* Relies on BKL */
> +		unsigned long page  = get_zeroed_page(GFP_KERNEL);
> +		if (page == 0)
>  			return -ENOMEM;
> +		if (port->xmit_buf)
> +			free_page(page);
> +		else
> +			port->xmit_buf = (unsigned char *) page;
>  	}


Still looks rather strange.  An if(x) inside an if(!x) ?

  OG.

  reply	other threads:[~2008-04-29 15:33 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-29 13:17 [PATCH] isicom: Fix buffer allocation Alan Cox
2008-04-29 15:26 ` Olivier Galibert [this message]
2008-04-29 15:59   ` Alan Cox

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=20080429152607.GA40409@dspnet.fr.eu.org \
    --to=galibert@pobox.com \
    --cc=alan@redhat.com \
    --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