From: Jeremy Huddleston Date: Tue, 11 Oct 2011 17:22:49 +0000 (-0700) Subject: linux sysfs: Fix read-write access in map_legacy X-Git-Tag: libpciaccess-0.12.902~4 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=af4478c52c960bee08209293aa14b784ac30dc05;p=platform%2Fupstream%2Flibpciaccess.git linux sysfs: Fix read-write access in map_legacy O_RDONLY | O_WRONLY != O_RDWR >< Reported-by: Javier Pello Signed-off-by: Jeremy Huddleston --- diff --git a/src/linux_sysfs.c b/src/linux_sysfs.c index 876abb1..d5ba66a 100644 --- a/src/linux_sysfs.c +++ b/src/linux_sysfs.c @@ -851,7 +851,7 @@ pci_device_linux_sysfs_map_legacy(struct pci_device *dev, pciaddr_t base, int ret=0; if (map_flags & PCI_DEV_MAP_FLAG_WRITABLE) { - flags |= O_WRONLY; + flags = O_RDWR; /* O_RDWR != O_WRONLY | O_RDONLY */; prot |= PROT_WRITE; }