summaryrefslogtreecommitdiffstats
path: root/fastbootd
diff options
context:
space:
mode:
authorHurri Lu <jlu32@marvell.com>2014-05-22 11:38:12 +0800
committerHurri Lu <jlu32@marvell.com>2014-05-22 12:51:39 +0800
commit473a729937476d5e18b5e10b7b2eff119202fd46 (patch)
tree8c6ed4dfa8a229510ae6ab4145805a7a66c78bfa /fastbootd
parent08c08f72617b13696049bf295646d6a68f3f1a8c (diff)
downloadsystem_core-473a729937476d5e18b5e10b7b2eff119202fd46.tar.gz
system_core-473a729937476d5e18b5e10b7b2eff119202fd46.tar.bz2
system_core-473a729937476d5e18b5e10b7b2eff119202fd46.zip
Judge mmap failed by MAP_FAILED instead of NULL
Change-Id: I74422cfdba341fcd1a6235044700cf3986e853d0 Signed-off-by: Hurri Lu <jlu32@marvell.com>
Diffstat (limited to 'fastbootd')
-rw-r--r--fastbootd/transport.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fastbootd/transport.c b/fastbootd/transport.c
index ce8f9d096..9a16fd767 100644
--- a/fastbootd/transport.c
+++ b/fastbootd/transport.c
@@ -55,7 +55,7 @@ int transport_handle_download(struct transport_handle *thandle, size_t len)
ftruncate(fd, len);
buffer = mmap(NULL, len, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
- if (buffer == NULL) {
+ if (buffer == MAP_FAILED) {
D(ERR, "mmap(%zu) failed: %d %s", len, errno, strerror(errno));
goto err;
}