From owner-freebsd-arch@FreeBSD.ORG Fri Jul 31 22:17:20 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 25B16106566C; Fri, 31 Jul 2009 22:17:20 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: from palm.hoeg.nl (mx0.hoeg.nl [IPv6:2001:7b8:613:100::211]) by mx1.freebsd.org (Postfix) with ESMTP id E0E928FC1F; Fri, 31 Jul 2009 22:17:19 +0000 (UTC) (envelope-from ed@hoeg.nl) Received: by palm.hoeg.nl (Postfix, from userid 1000) id 4EC4A1CD94; Sat, 1 Aug 2009 00:17:19 +0200 (CEST) Date: Sat, 1 Aug 2009 00:17:19 +0200 From: Ed Schouten To: Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Message-ID: <20090731221719.GS1292@hoeg.nl> References: <4A72B1DC.3040907@delphij.net> <86ocr062w9.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Wt10+cXOThorkX0z" Content-Disposition: inline In-Reply-To: <86ocr062w9.fsf@ds4.des.no> User-Agent: Mutt/1.5.20 (2009-06-14) Cc: jmg@FreeBSD.org, d@delphij.net, MQ , 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: Fri, 31 Jul 2009 22:17:20 -0000 --Wt10+cXOThorkX0z Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi Dag-Erling, * Dag-Erling Sm=F8rgrav wrote: > Xin LI writes: > > I think these should be fixed, and here is my proposed patch. >=20 > 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, mflag); + list =3D malloc(size * sizeof *list, M_KQUEUE, mflag); 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 list); + kq->kq_knlistsize * sizeof *list); 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 list); + (size - kq->kq_knlistsize) * sizeof *list); kq->kq_knlistsize =3D size; kq->kq_knlist =3D list; } --=20 Ed Schouten WWW: http://80386.nl/ --Wt10+cXOThorkX0z Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.9 (FreeBSD) iEYEARECAAYFAkpzbW8ACgkQ52SDGA2eCwXWdACeMw2Xu46RripyiwLKklHHEuS0 VQAAnA+CFWNyG2TZTQsU2fbcj1acL+62 =EaP6 -----END PGP SIGNATURE----- --Wt10+cXOThorkX0z--