mtd: parsers: tplink_safeloader: fix uninitialized variable bug
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 25 Oct 2022 15:34:24 +0000 (18:34 +0300)
committerMiquel Raynal <miquel.raynal@bootlin.com>
Mon, 7 Nov 2022 16:11:33 +0000 (17:11 +0100)
commit6c0a15a3dc6b45156c5b9568c8308e3f0d802af0
tree277fd664f5fae07897bb5627c17e99ce64617503
parent00a3588084bee6f37bb2b1d343f96900cfe049bc
mtd: parsers: tplink_safeloader: fix uninitialized variable bug

On 64 bit systems, the highest 32 bits of the "offset" variable are
not initialized.  Also the existing code is not endian safe (it will
fail on big endian systems).  Change the type of "offset" to a u32.

Fixes: aec4d5f5ffd0 ("mtd: parsers: add TP-Link SafeLoader partitions table parser")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Acked-by: Rafał Miłecki <rafal@milecki.pl>
Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com>
Link: https://lore.kernel.org/linux-mtd/Y1gCALFWXYYwqV1P@kili
drivers/mtd/parsers/tplink_safeloader.c