lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Sat, 15 Dec 2007 14:04:42 +0100 (CET)
From:	Stefan Richter <stefanr@...6.in-berlin.de>
To:	Nick Piggin <npiggin@...e.de>
cc:	akpm@...ux-foundation.org, linux1394-devel@...ts.sourceforge.net,
	linux-kernel@...r.kernel.org
Subject: Re: [patch 06/18] ieee1394: nopage

On  6 Dec, Nick Piggin wrote:
> On Wed, Dec 05, 2007 at 02:09:48PM +0100, Stefan Richter wrote:
>> npiggin@...e.de wrote:
>> > +	if (vmf->pgoff >= dma->n_pages)
>> > +		goto error;
>> > +
>> > +	kernel_virt_addr = (unsigned long)dma->kvirt + (vmf->pgoff << PAGE_SHIFT);
>> > +	vmf->page = vmalloc_to_page((void *)kernel_virt_addr);
>> > +	get_page(vmf->page);
>> > +	return 0;
>> > +
>> > +      error:
>> > +	return VM_FAULT_SIGBUS;
>> >  }
>> 
>> Why not replacing the two 'goto error' by 'return VM_FAULT_SIGBUS'?  If
>> there is no cleanup after that error jump, I find it sensible to return
>> early.
> 
> Fair enough, I just didn't want to gamut of reactions from maintainers
> to my cleanups ;)


Subject: ieee1394: small cleanup after "nopage"

Signed-off-by: Stefan Richter <stefanr@...6.in-berlin.de>
---
 drivers/ieee1394/dma.c |   16 ++++------------
 1 file changed, 4 insertions(+), 12 deletions(-)

Index: linux/drivers/ieee1394/dma.c
===================================================================
--- linux.orig/drivers/ieee1394/dma.c
+++ linux/drivers/ieee1394/dma.c
@@ -231,28 +231,20 @@ void dma_region_sync_for_device(struct d
 
 #ifdef CONFIG_MMU
 
-/* fault() handler for mmap access */
-
 static int dma_region_pagefault(struct vm_area_struct *vma,
-					struct vm_fault *vmf)
+				struct vm_fault *vmf)
 {
-	unsigned long kernel_virt_addr;
-
 	struct dma_region *dma = (struct dma_region *)vma->vm_private_data;
 
 	if (!dma->kvirt)
-		goto error;
+		return VM_FAULT_SIGBUS;
 
 	if (vmf->pgoff >= dma->n_pages)
-		goto error;
+		return VM_FAULT_SIGBUS;
 
-	kernel_virt_addr = (unsigned long)dma->kvirt + (vmf->pgoff << PAGE_SHIFT);
-	vmf->page = vmalloc_to_page((void *)kernel_virt_addr);
+	vmf->page = vmalloc_to_page(dma->kvirt + (vmf->pgoff << PAGE_SHIFT));
 	get_page(vmf->page);
 	return 0;
-
-      error:
-	return VM_FAULT_SIGBUS;
 }
 
 static struct vm_operations_struct dma_region_vm_ops = {


-- 
Stefan Richter
-=====-=-=== ==-- -====
http://arcgraph.de/sr/

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ