From: Junkyeong Kim Date: Thu, 30 Jun 2016 13:16:43 +0000 (+0900) Subject: initialize buf, use integer variable for read X-Git-Tag: accepted/tizen/3.0.m2/mobile/20170105.024655^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F03%2F77703%2F1;p=platform%2Fupstream%2Flibpciaccess.git initialize buf, use integer variable for read Change-Id: I6c3971a78581e90122ae6b9a95b6d4f99bde7a46 Signed-off-by: Junkyeong Kim --- diff --git a/src/common_bridge.c b/src/common_bridge.c index b4b5d7e..e6197af 100644 --- a/src/common_bridge.c +++ b/src/common_bridge.c @@ -56,7 +56,7 @@ static int read_bridge_info( struct pci_device_private * priv ) { - uint8_t buf[0x40]; + uint8_t buf[0x40] = {0, }; pciaddr_t bytes; int err; diff --git a/src/linux_sysfs.c b/src/linux_sysfs.c index 97fcf36..ce6f295 100644 --- a/src/linux_sysfs.c +++ b/src/linux_sysfs.c @@ -247,13 +247,14 @@ pci_device_linux_sysfs_probe( struct pci_device * dev ) dev->func ); fd = open( name, O_RDONLY | O_CLOEXEC); if ( fd != -1 ) { + int ret; char * next; pciaddr_t low_addr; pciaddr_t high_addr; pciaddr_t flags; - bytes = read( fd, resource, 512 ); + ret = read( fd, resource, 512 ); resource[511] = '\0'; close( fd );