From: jsg Date: Thu, 1 May 2014 10:25:44 +0000 (+0000) Subject: move pointer use to after a NULL pointer check X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=b41263792bba4d82ecd46cf4c20737065614f039;p=openbsd move pointer use to after a NULL pointer check ok dlg@ --- diff --git a/sys/scsi/mpath.c b/sys/scsi/mpath.c index 1f26e6b60b1..777397d7e6d 100644 --- a/sys/scsi/mpath.c +++ b/sys/scsi/mpath.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mpath.c,v 1.34 2013/09/08 09:47:36 dlg Exp $ */ +/* $OpenBSD: mpath.c,v 1.35 2014/05/01 10:25:44 jsg Exp $ */ /* * Copyright (c) 2009 David Gwynne @@ -542,13 +542,14 @@ int mpath_path_detach(struct mpath_path *p) { struct mpath_group *g = p->p_group; - struct mpath_dev *d = g->g_dev; + struct mpath_dev *d; struct mpath_path *np = NULL; #ifdef DIAGNOSTIC if (g == NULL) panic("mpath: detaching a path from a nonexistant bus"); #endif + d = g->g_dev; p->p_group = NULL; mtx_enter(&d->d_mtx);