[coreboot] [PATCH] chipset_enable: Fix open /dev/cpu
Carl-Daniel Hailfinger
c-d.hailfinger.devel.2006 at gmx.net
Wed May 6 00:11:46 CEST 2009
Hi Bertrand,
On 05.05.2009 22:22, Beber wrote:
> Here is a fix for chipset_enable.c when there is not /dev/cpu. Open
> fail no there is not reason to lseek in. Actually this is a trivial fix
> for not well handled return from open.
>
Although the fix seems trivial, it breaks the code a few lines down.
With the old code, you got a meaningful error message about having to
run "modprobe msr". This error message does not trigger anymore with the
new code.
Please fix. Thanks.
Regards,
Carl-Daniel
> Signed-off-by: Bertrand Jacquin <beber at meleeweb.net>
>
> Index: chipset_enable.c
> ===================================================================
> --- chipset_enable.c (revision 461)
> +++ chipset_enable.c (working copy)
> @@ -511,7 +511,7 @@
> unsigned char buf[8];
>
> fd_msr = open("/dev/cpu/0/msr", O_RDWR);
> - if (!fd_msr) {
> + if (fd_msr == -1) {
> perror("open msr");
> return -1;
> }
>
>
--
http://www.hailfinger.org/
More information about the coreboot
mailing list