From owner-freebsd-bugs@FreeBSD.ORG Mon Jan 19 15:10:03 2009 Return-Path: Delivered-To: freebsd-bugs@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id AA4AA1065674 for ; Mon, 19 Jan 2009 15:10:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 97AA08FC1C for ; Mon, 19 Jan 2009 15:10:03 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (gnats@localhost [127.0.0.1]) by freefall.freebsd.org (8.14.3/8.14.3) with ESMTP id n0JFA3V4045547 for ; Mon, 19 Jan 2009 15:10:03 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.3/8.14.3/Submit) id n0JFA3TY045546; Mon, 19 Jan 2009 15:10:03 GMT (envelope-from gnats) Date: Mon, 19 Jan 2009 15:10:03 GMT Message-Id: <200901191510.n0JFA3TY045546@freefall.freebsd.org> To: freebsd-bugs@FreeBSD.org From: Jaakko Heinonen Cc: Subject: Re: kern/130735: [patch] pass M_NOWAIT to the malloc() call inside cdreaddvdstructure() X-BeenThere: freebsd-bugs@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: Jaakko Heinonen List-Id: Bug reports List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 19 Jan 2009 15:10:04 -0000 The following reply was made to PR kern/130735; it has been noted by GNATS. From: Jaakko Heinonen To: Eygene Ryabinkin Cc: bug-followup@FreeBSD.org Subject: Re: kern/130735: [patch] pass M_NOWAIT to the malloc() call inside cdreaddvdstructure() Date: Mon, 19 Jan 2009 17:06:47 +0200 Hi, On 2009-01-19, Eygene Ryabinkin wrote: > --- a/sys/cam/scsi/scsi_cd.c > +++ b/sys/cam/scsi/scsi_cd.c > @@ -4063,7 +4063,7 @@ cdreaddvdstructure(struct cam_periph *periph, struct dvd_struct *dvdstruct) > } > > if (length != 0) { > - databuf = malloc(length, M_DEVBUF, M_WAITOK | M_ZERO); > + databuf = malloc(length, M_DEVBUF, M_NOWAIT | M_ZERO); > } else > databuf = NULL; This change doesn't look correct. If you use M_NOWAIT malloc(9) can fail and return NULL. You should check the return value. -- Jaakko