Commit 5d98a98d authored by Bo YU's avatar Bo YU Committed by Greg Kroah-Hartman

powerpc/boot: Fix missing check of lseek() return value

[ Upstream commit 5d085ec0 ]

This is detected by Coverity scan: CID: 1440481
Signed-off-by: default avatarBo YU <tsu.yubo@gmail.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent f4456a34
...@@ -223,7 +223,11 @@ main(int ac, char **av) ...@@ -223,7 +223,11 @@ main(int ac, char **av)
PUT_16(E_PHNUM, np + 2); PUT_16(E_PHNUM, np + 2);
/* write back */ /* 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); i = write(fd, buf, n);
if (i < 0) { if (i < 0) {
perror("write"); perror("write");
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment