Check pointer for NULL before dereferencing it, not after.

PR:		138384
Submitted by:	Patroklos Argyroudis <argp@census-labs.com>
MFC after:	1 week
This commit is contained in:
brueffer 2009-10-21 15:04:50 +00:00
parent cc204586da
commit 8d08f24520

View File

@ -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");