mirror of
https://github.com/Evolution-X-Devices/kernel_google_b1c1
synced 2026-02-01 07:34:20 +00:00
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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
da8db898f9
commit
bfcbe50579
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user