From 82d11b03016e508ef7100da9ba6d0287bc6dfae9 Mon Sep 17 00:00:00 2001 From: Matt Jacob Date: Sun, 27 Dec 2009 22:50:25 +0000 Subject: [PATCH] MFC of 198329: Check pointer for NULL before dereferencing it, not after. --- sys/dev/ips/ips_disk.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/ips/ips_disk.c b/sys/dev/ips/ips_disk.c index 9e2fd5c2535..12bdacd6311 100644 --- a/sys/dev/ips/ips_disk.c +++ b/sys/dev/ips/ips_disk.c @@ -192,10 +192,10 @@ ipsd_dump(void *arg, void *virtual, vm_offset_t physical, off_t offset, dp = arg; dsc = dp->d_drv1; - sc = dsc->sc; if (dsc == NULL) return (EINVAL); + sc = dsc->sc; if (ips_get_free_cmd(sc, &command, 0) != 0) { printf("ipsd: failed to get cmd for dump\n");