summaryrefslogtreecommitdiff
path: root/arch/powerpc
diff options
context:
space:
mode:
authorBo YU <tsu.yubo@gmail.com>2018-10-30 09:21:55 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-31 06:46:11 -0700
commit1a6767f5f152724b948aaff55926a38d4e9ed938 (patch)
tree3085aca2c1238cfc4c86dad7b0dfb33486785954 /arch/powerpc
parent741853944fea8927781e2d659c9cb2dc888a92ec (diff)
downloadlinux-rpi3-1a6767f5f152724b948aaff55926a38d4e9ed938.tar.gz
linux-rpi3-1a6767f5f152724b948aaff55926a38d4e9ed938.tar.bz2
linux-rpi3-1a6767f5f152724b948aaff55926a38d4e9ed938.zip
powerpc/boot: Fix missing check of lseek() return value
[ Upstream commit 5d085ec04a000fefb5182d3b03ee46ca96d8389b ] This is detected by Coverity scan: CID: 1440481 Signed-off-by: Bo YU <tsu.yubo@gmail.com> Signed-off-by: Michael Ellerman <mpe@ellerman.id.au> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/boot/addnote.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/powerpc/boot/addnote.c b/arch/powerpc/boot/addnote.c
index 9d9f6f334d3c..3da3e2b1b51b 100644
--- a/arch/powerpc/boot/addnote.c
+++ b/arch/powerpc/boot/addnote.c
@@ -223,7 +223,11 @@ main(int ac, char **av)
PUT_16(E_PHNUM, np + 2);
/* write back */
- lseek(fd, (long) 0, SEEK_SET);
+ i = lseek(fd, (long) 0, SEEK_SET);
+ if (i < 0) {
+ perror("lseek");
+ exit(1);
+ }
i = write(fd, buf, n);
if (i < 0) {
perror("write");