Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/dev/scsipi Fix memory leak.



details:   https://anonhg.NetBSD.org/src/rev/131d3e2d3afc
branches:  trunk
changeset: 350135:131d3e2d3afc
user:      mlelstv <mlelstv%NetBSD.org@localhost>
date:      Thu Jan 05 16:35:33 2017 +0000

description:
Fix memory leak.

Found by maxv@

diffstat:

 sys/dev/scsipi/cd.c |  14 +++++++-------
 1 files changed, 7 insertions(+), 7 deletions(-)

diffs (35 lines):

diff -r d5bc74e1b0d1 -r 131d3e2d3afc sys/dev/scsipi/cd.c
--- a/sys/dev/scsipi/cd.c       Thu Jan 05 16:23:31 2017 +0000
+++ b/sys/dev/scsipi/cd.c       Thu Jan 05 16:35:33 2017 +0000
@@ -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,
@@ -50,7 +50,7 @@
  */
 
 #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/systm.h>
@@ -2815,11 +2815,11 @@
        if (error) {
                /* discinfo call failed, emulate for cd-rom/dvd-rom */
                if (mmc_discinfo->mmc_profile == 0x08) /* CD-ROM */
-                       return mmc_getdiscinfo_cdrom(periph, mmc_discinfo);
-               if (mmc_discinfo->mmc_profile == 0x10) /* DVD-ROM */
-                       return mmc_getdiscinfo_dvdrom(periph, mmc_discinfo);
-               /* CD/DVD drive is violating specs */
-               error = EIO;
+                       error = mmc_getdiscinfo_cdrom(periph, mmc_discinfo);
+               else if (mmc_discinfo->mmc_profile == 0x10) /* DVD-ROM */
+                       error = mmc_getdiscinfo_dvdrom(periph, mmc_discinfo);
+               else /* CD/DVD drive is violating specs */
+                       error = EIO;
                goto out;
        }
 



Home | Main Index | Thread Index | Old Index