summaryrefslogtreecommitdiffstats
path: root/sys/dev/ips/ips_disk.c
diff options
context:
space:
mode:
authorbrueffer <brueffer@FreeBSD.org>2009-10-21 15:04:50 +0000
committerbrueffer <brueffer@FreeBSD.org>2009-10-21 15:04:50 +0000
commit8d08f24520cdd275e525ba348b859eb00aebe848 (patch)
treeb883607af38df13c37adb876a384ec1ed41cfe27 /sys/dev/ips/ips_disk.c
parentcc204586da6b8c494cd97243b92cfbe155d370fe (diff)
downloadFreeBSD-src-8d08f24520cdd275e525ba348b859eb00aebe848.zip
FreeBSD-src-8d08f24520cdd275e525ba348b859eb00aebe848.tar.gz
Check pointer for NULL before dereferencing it, not after.
PR: 138384 Submitted by: Patroklos Argyroudis <argp@census-labs.com> MFC after: 1 week
Diffstat (limited to 'sys/dev/ips/ips_disk.c')
-rw-r--r--sys/dev/ips/ips_disk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/ips/ips_disk.c b/sys/dev/ips/ips_disk.c
index 9e2fd5c..12bdacd 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");
OpenPOWER on IntegriCloud