Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/ata Initialize b_resid before biodone in wdioctlstra...



details:   https://anonhg.NetBSD.org/src/rev/dc3557acf0f4
branches:  trunk
changeset: 783817:dc3557acf0f4
user:      riastradh <riastradh%NetBSD.org@localhost>
date:      Wed Jan 09 22:03:49 2013 +0000

description:
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.

diffstat:

 sys/dev/ata/wd.c |  5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diffs (25 lines):

diff -r 0d8b4b94afde -r dc3557acf0f4 sys/dev/ata/wd.c
--- a/sys/dev/ata/wd.c  Wed Jan 09 21:58:23 2013 +0000
+++ b/sys/dev/ata/wd.c  Wed Jan 09 22:03:49 2013 +0000
@@ -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 @@
        return;
 bad:
        bp->b_error = error;
+       bp->b_resid = bp->b_bcount;
        biodone(bp);
 }



Home | Main Index | Thread Index | Old Index