Module Name:    src
Committed By:   riastradh
Date:           Wed Jan  9 22:03:49 UTC 2013

Modified Files:
        src/sys/dev/ata: wd.c

Log Message:
Initialize b_resid before biodone in wdioctlstrategy error branch.

Otherwise we may panic when physio's biodone callback kasserts
something about b_resid, since nothing will have initialized it.


To generate a diff of this commit:
cvs rdiff -u -r1.401 -r1.402 src/sys/dev/ata/wd.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/sys/dev/ata/wd.c
diff -u src/sys/dev/ata/wd.c:1.401 src/sys/dev/ata/wd.c:1.402
--- src/sys/dev/ata/wd.c:1.401	Fri Oct 19 17:09:07 2012
+++ src/sys/dev/ata/wd.c	Wed Jan  9 22:03:49 2013
@@ -1,4 +1,4 @@
-/*	$NetBSD: wd.c,v 1.401 2012/10/19 17:09:07 drochner Exp $ */
+/*	$NetBSD: wd.c,v 1.402 2013/01/09 22:03:49 riastradh Exp $ */
 
 /*
  * Copyright (c) 1998, 2001 Manuel Bouyer.  All rights reserved.
@@ -54,7 +54,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.401 2012/10/19 17:09:07 drochner Exp $");
+__KERNEL_RCSID(0, "$NetBSD: wd.c,v 1.402 2013/01/09 22:03:49 riastradh Exp $");
 
 #include "opt_ata.h"
 
@@ -2195,5 +2195,6 @@ wdioctlstrategy(struct buf *bp)
 	return;
 bad:
 	bp->b_error = error;
+	bp->b_resid = bp->b_bcount;
 	biodone(bp);
 }

Reply via email to