From owner-freebsd-acpi@FreeBSD.ORG Sat Sep 30 12:34:31 2006 Return-Path: X-Original-To: freebsd-acpi@freebsd.org Delivered-To: freebsd-acpi@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5CB9A16A706 for ; Sat, 30 Sep 2006 12:34:31 +0000 (UTC) (envelope-from matteo@freebsd.org) Received: from vsmtp1.tin.it (vsmtp1.tin.it [212.216.176.141]) by mx1.FreeBSD.org (Postfix) with ESMTP id 0CFCA43D6B for ; Sat, 30 Sep 2006 12:32:50 +0000 (GMT) (envelope-from matteo@freebsd.org) Received: from kaiser.sig11.org (87.2.178.234) by vsmtp1.tin.it (7.2.072.1) id 451BEB280017B632 for freebsd-acpi@freebsd.org; Sat, 30 Sep 2006 14:32:48 +0200 Received: from kaiser.sig11.org (localhost [127.0.0.1]) by kaiser.sig11.org (8.13.8/8.13.7) with ESMTP id k8UCWlPZ085306 for ; Sat, 30 Sep 2006 14:32:47 +0200 (CEST) (envelope-from matteo@freebsd.org) Received: (from rionda@localhost) by kaiser.sig11.org (8.13.8/8.13.7/Submit) id k8UCWjJF085305 for freebsd-acpi@freebsd.org; Sat, 30 Sep 2006 14:32:45 +0200 (CEST) (envelope-from matteo@freebsd.org) X-Authentication-Warning: kaiser.sig11.org: rionda set sender to matteo@freebsd.org using -f Date: Sat, 30 Sep 2006 14:32:44 +0200 From: Matteo Riondato To: freebsd-acpi@freebsd.org Message-ID: <20060930123244.GA29307@kaiser.sig11.org> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha1; protocol="application/pgp-signature"; boundary="Bu8it7iiRSEf40bY" Content-Disposition: inline User-Agent: Mutt/1.5.12-2006-07-14 Subject: Powerd patch review X-BeenThere: freebsd-acpi@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: ACPI and power management development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 30 Sep 2006 12:34:31 -0000 --Bu8it7iiRSEf40bY Content-Type: multipart/mixed; boundary="JP+T4n/bALQSJXh8" Content-Disposition: inline --JP+T4n/bALQSJXh8 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Hi folks, I'm writing you to ask if you could be so kind to review the attached patch to src/usr.sbin/powerd/powerd.c . It should fix the problem descripted in PR bin/97198. I haven't a broken BIOS to test if it really works, but it should.=20 Thanks Best regards P.s. I'm not subscribed to the list, so please CC me. --=20 Matteo Riondato FreeBSD Committer (http://www.freebsd.org) G.U.F.I. Staff Member (http://www.gufi.org) FreeSBIE Developer (http://www.freesbie.org) --JP+T4n/bALQSJXh8 Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="powerd.c.diff" Content-Transfer-Encoding: quoted-printable Index: powerd.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 RCS file: /home/rionda/branch/ncvs/src/usr.sbin/powerd/powerd.c,v retrieving revision 1.20 diff -u -r1.20 powerd.c --- powerd.c 19 Feb 2006 00:40:28 -0000 1.20 +++ powerd.c 29 Sep 2006 15:55:47 -0000 @@ -182,9 +182,22 @@ free(*power); return (-1); } + if (i > 0) { + if ((*freqs)[i] =3D=3D (*freqs)[i-1]) { + i--; + (*numfreqs)--; + } + } p =3D q + 1; } =20 + if ((*freqs =3D reallocf(*freqs, *numfreqs * sizeof(int))) =3D=3D + NULL) { + free(freqstr); + free(*power); + return (-1); + } + free(freqstr); return (0); } --JP+T4n/bALQSJXh8-- --Bu8it7iiRSEf40bY Content-Type: application/pgp-signature Content-Disposition: inline -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.5 (FreeBSD) iD8DBQFFHmPs2Mp4pR7Fa+wRAvPQAJ99PaUkoaMgut85LV+kUDAvtDg5ZgCeNGSe 8DmQaRpiZF462VbyHRs3eTM= =bpP5 -----END PGP SIGNATURE----- --Bu8it7iiRSEf40bY--