mtd: check the return value of malloc and pread
authorQiyuan Zhang <zhang.github@outlook.com>
Mon, 5 Aug 2024 10:47:21 +0000 (06:47 -0400)
committerRobert Marko <robimarko@gmail.com>
Sun, 16 Feb 2025 12:03:23 +0000 (13:03 +0100)
commit082608fd2bc29dc2d9a7d4d7dc3463d72e2989f6
treeaea079145d83e12d4bd5ab370e90947380ea641f
parent45ce95a9b31c5c3a86d99a79508c8a176b304831
mtd: check the return value of malloc and pread

Check the return value of malloc and pread in case they fail.

Signed-off-by: Qiyuan Zhang <zhang.github@outlook.com>
Link: https://github.com/openwrt/openwrt/pull/16070
(cherry picked from commit 3f014543cd4bd099dc089cbb9b9b2d7b0db8a021)
Signed-off-by: Rafal Boni <rafal.boni@gmail.com>
Link: https://github.com/openwrt/openwrt/pull/17889
Signed-off-by: Robert Marko <robimarko@gmail.com>
package/system/mtd/src/linksys_bootcount.c