public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Rik van Riel <riel@redhat.com>
To: Roel Kluin <12o3l@tiscali.nl>
Cc: lkml <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] return hidden bug
Date: Sun, 21 Oct 2007 21:42:09 -0400	[thread overview]
Message-ID: <20071021214209.1a7567d7@bree.surriel.com> (raw)
In-Reply-To: <471BF741.2020501@tiscali.nl>

On Mon, 22 Oct 2007 03:05:05 +0200
Roel Kluin <12o3l@tiscali.nl> wrote:

>     return hidden bug
>     
>     Signed-off-by: Roel Kluin <12o3l@tiscali.nl>
> 
> diff --git a/arch/alpha/kernel/pci_iommu.c
> b/arch/alpha/kernel/pci_iommu.c index e1c4707..6a69425 100644
> --- a/arch/alpha/kernel/pci_iommu.c
> +++ b/arch/alpha/kernel/pci_iommu.c
> @@ -365,8 +365,8 @@ pci_unmap_single(struct pci_dev *pdev, dma_addr_t
> dma_addr, size_t size, printk(KERN_ERR "Bogus pci_unmap_single:
> dma_addr %lx " " base %lx size %x\n", dma_addr, arena->dma_base,
>  		       arena->size);
> -		return;
>  		BUG();
> +		return;
>  	}
>  
>  	npages = calc_npages((dma_addr & ~PAGE_MASK) + size);

BUG() will terminate the process that runs into it, so you can
just remove the return alltogether.  If BUG() is hit, the return
will never be reached.

-- 
"Debugging is twice as hard as writing the code in the first place.
Therefore, if you write the code as cleverly as possible, you are,
by definition, not smart enough to debug it." - Brian W. Kernighan

  reply	other threads:[~2007-10-22  1:42 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-10-22  1:05 [PATCH] return hidden bug Roel Kluin
2007-10-22  1:42 ` Rik van Riel [this message]
2007-10-22  1:53   ` Roel Kluin
2007-10-22  3:08     ` Rik van Riel
2007-10-22  5:02   ` Herbert Xu
2007-10-22  9:30   ` Pekka Enberg
2007-10-22 15:19     ` Rik van Riel
2007-10-22 15:23       ` Pekka Enberg
2007-10-22 16:42   ` Ray Lee
2007-10-22 17:56     ` Roel Kluin
2007-10-22 18:12       ` Ray Lee
2007-10-22 18:52         ` Roel Kluin
2007-10-22 22:26           ` Rene Herman
2007-10-22 23:00             ` Ray Lee
2007-10-23  0:15               ` Rene Herman
2007-10-22 18:36   ` Matt Mackall

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=20071021214209.1a7567d7@bree.surriel.com \
    --to=riel@redhat.com \
    --cc=12o3l@tiscali.nl \
    --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