summaryrefslogtreecommitdiffstats
path: root/drivers/mtd/parsers/tplink_safeloader.c
Commit message (Collapse)AuthorAgeFilesLines
* mtd: parsers: Fix potential memory leak in mtd_parser_tplink_safeloader_parse()Yuan Can2023-01-021-1/+3
| | | | | | | | | | | The parts needs to be freed with all its elements, otherwise it will be leaked. Fixes: 00a3588084be ("mtd: parsers: add TP-Link SafeLoader partitions table parser") Signed-off-by: Yuan Can <yuancan@huawei.com> Reviewed-by: Dan Carpenter <error27@gmail.com> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20221208113620.78855-1-yuancan@huawei.com
* mtd: parsers: tplink_safeloader: fix uninitialized variable bugDan Carpenter2022-11-071-3/+3
| | | | | | | | | | | | 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
* mtd: parsers: add TP-Link SafeLoader partitions table parserRafał Miłecki2022-11-071-0/+150
This parser deals with most TP-Link home routers. It reads info about partitions and registers them in the MTD subsystem. Example from TP-Link Archer C5 V2: spi-nor spi0.0: s25fl128s1 (16384 Kbytes) 15 tplink-safeloader partitions found on MTD device spi0.0 Creating 15 MTD partitions on "spi0.0": 0x000000000000-0x000000040000 : "fs-uboot" 0x000000040000-0x000000440000 : "os-image" 0x000000440000-0x000000e40000 : "rootfs" 0x000000e40000-0x000000e40200 : "default-mac" 0x000000e40200-0x000000e40400 : "pin" 0x000000e40400-0x000000e40600 : "product-info" 0x000000e50000-0x000000e60000 : "partition-table" 0x000000e60000-0x000000e60200 : "soft-version" 0x000000e61000-0x000000e70000 : "support-list" 0x000000e70000-0x000000e80000 : "profile" 0x000000e80000-0x000000e90000 : "default-config" 0x000000e90000-0x000000ee0000 : "user-config" 0x000000ee0000-0x000000fe0000 : "log" 0x000000fe0000-0x000000ff0000 : "radio_bk" 0x000000ff0000-0x000001000000 : "radio" Signed-off-by: Rafał Miłecki <rafal@milecki.pl> Signed-off-by: Miquel Raynal <miquel.raynal@bootlin.com> Link: https://lore.kernel.org/linux-mtd/20221015092950.27467-2-zajec5@gmail.com