From owner-freebsd-arch@FreeBSD.ORG Sat Aug 1 06:59:32 2009 Return-Path: Delivered-To: freebsd-arch@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id E5F80106566B; Sat, 1 Aug 2009 06:59:31 +0000 (UTC) (envelope-from antinvidia@gmail.com) Received: from mail-vw0-f180.google.com (mail-vw0-f180.google.com [209.85.212.180]) by mx1.freebsd.org (Postfix) with ESMTP id 837898FC0C; Sat, 1 Aug 2009 06:59:31 +0000 (UTC) (envelope-from antinvidia@gmail.com) Received: by vws10 with SMTP id 10so583713vws.7 for ; Fri, 31 Jul 2009 23:59:30 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=domainkey-signature:mime-version:received:in-reply-to:references :date:message-id:subject:from:to:cc:content-type :content-transfer-encoding; bh=91Py4cDSprVwc2jPIFSKGfJI5B0QL6qjwhEV1ORiots=; b=mVUm9gq2rkk6LTOCvAsSwSmU+9tT2k1clfXakXsY9B2ab/+fMcoYeF4B6/0IQzWG2j 0K7v7mzm33MO+4LZN4C76p3Cc8VifgfsJJBho8dS5M4pQanSRBgrUmWNiKTJXRLhww9d h8W3Z+tjyPUynGAem3gijN7sn93iE/jke1Ci4= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :cc:content-type:content-transfer-encoding; b=x8iSlzwaAGAZyaItrYQlDw0vIvws6PA3y+QNmG31kpOFd2Nh16OHuaCvjQGyf342MD /MPcIzTEa07BnM77SykU+KMySfmw3AikGYOJqeeHIJeNINvCDKluJbIVYvrinrZGBrrr Tsw0o4k8AhbAsYRLIN7ThqstIlLZEKbUoWPkE= MIME-Version: 1.0 Received: by 10.220.45.205 with SMTP id g13mr3669396vcf.24.1249108353296; Fri, 31 Jul 2009 23:32:33 -0700 (PDT) In-Reply-To: <20090731221719.GS1292@hoeg.nl> References: <4A72B1DC.3040907@delphij.net> <86ocr062w9.fsf@ds4.des.no> <20090731221719.GS1292@hoeg.nl> Date: Sat, 1 Aug 2009 14:32:33 +0800 Message-ID: From: MQ To: Ed Schouten Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: quoted-printable Cc: jmg@freebsd.org, =?ISO-8859-1?Q?Dag=2DErling_Sm=F8rgrav?= , d@delphij.net, freebsd-arch@freebsd.org Subject: Re: [PATCH] type issue in kern_event.c X-BeenThere: freebsd-arch@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussion related to FreeBSD architecture List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 01 Aug 2009 06:59:32 -0000 2009/8/1 Ed Schouten : > Hi Dag-Erling, > > * Dag-Erling Sm=F8rgrav wrote: >> Xin LI writes: >> > I think these should be fixed, and here is my proposed patch. >> >> 404 Patch Not Found > > Xin Li sent it to me, but I think he has forgotten to add the lists back > to Cc again. Here's the patch he sent to me earlier today. > > Index: kern_event.c > =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D > --- kern_event.c (revision 195945) > +++ kern_event.c (working copy) > @@ -1106,7 +1106,7 @@ kqueue_expand(struct kqueue *kq, struct filterops > size =3D kq->kq_knlistsize; > while (size <=3D fd) > size +=3D KQEXTENT; > - list =3D malloc(size * sizeof list, M_KQUEUE, mfl= ag); > + list =3D malloc(size * sizeof *list, M_KQUEUE, mf= lag); > if (list =3D=3D NULL) > return ENOMEM; > KQ_LOCK(kq); > @@ -1116,13 +1116,13 @@ kqueue_expand(struct kqueue *kq, struct filterops > } else { > if (kq->kq_knlist !=3D NULL) { > bcopy(kq->kq_knlist, list, > - kq->kq_knlistsize * sizeof li= st); > + kq->kq_knlistsize * sizeof *l= ist); > free(kq->kq_knlist, M_KQUEUE); > kq->kq_knlist =3D NULL; > } > bzero((caddr_t)list + > kq->kq_knlistsize * sizeof list, > - (size - kq->kq_knlistsize) * sizeof l= ist); > + (size - kq->kq_knlistsize) * sizeof *= list); > kq->kq_knlistsize =3D size; > kq->kq_knlist =3D list; > } > > -- > Ed Schouten > WWW: http://80386.nl/ > The sizof in the first argument of bzero should also be replaced.