Fix memory leak.

Found by maxv@
This commit is contained in:
mlelstv 2017-01-05 16:35:33 +00:00
parent 83809af30d
commit 65353cac77

View File

@ -1,4 +1,4 @@
/* $NetBSD: cd.c,v 1.338 2016/12/21 21:28:30 mlelstv Exp $ */ /* $NetBSD: cd.c,v 1.339 2017/01/05 16:35:33 mlelstv Exp $ */
/*- /*-
* Copyright (c) 1998, 2001, 2003, 2004, 2005, 2008 The NetBSD Foundation, * Copyright (c) 1998, 2001, 2003, 2004, 2005, 2008 The NetBSD Foundation,
@ -50,7 +50,7 @@
*/ */
#include <sys/cdefs.h> #include <sys/cdefs.h>
__KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.338 2016/12/21 21:28:30 mlelstv Exp $"); __KERNEL_RCSID(0, "$NetBSD: cd.c,v 1.339 2017/01/05 16:35:33 mlelstv Exp $");
#include <sys/param.h> #include <sys/param.h>
#include <sys/systm.h> #include <sys/systm.h>
@ -2815,11 +2815,11 @@ mmc_getdiscinfo(struct scsipi_periph *periph,
if (error) { if (error) {
/* discinfo call failed, emulate for cd-rom/dvd-rom */ /* discinfo call failed, emulate for cd-rom/dvd-rom */
if (mmc_discinfo->mmc_profile == 0x08) /* CD-ROM */ if (mmc_discinfo->mmc_profile == 0x08) /* CD-ROM */
return mmc_getdiscinfo_cdrom(periph, mmc_discinfo); error = mmc_getdiscinfo_cdrom(periph, mmc_discinfo);
if (mmc_discinfo->mmc_profile == 0x10) /* DVD-ROM */ else if (mmc_discinfo->mmc_profile == 0x10) /* DVD-ROM */
return mmc_getdiscinfo_dvdrom(periph, mmc_discinfo); error = mmc_getdiscinfo_dvdrom(periph, mmc_discinfo);
/* CD/DVD drive is violating specs */ else /* CD/DVD drive is violating specs */
error = EIO; error = EIO;
goto out; goto out;
} }