mtd: fix kfree bcm47xxsflash
PATCH 1/1 mtd: fix kfree bcm47xxsflash
From: Libo Chen <[email protected]>
mtd is just member of bcm47xxsflash, so we should free bcm47xxsflash not its member.
--- drivers/mtd/devices/bcm47xxsflash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/mtd/devices/bcm47xxsflash.c +1 -1
@@ -76,7 +76,7 @@ static int bcm47xxsflash_bcma_probe(struct platform_device *pdev)return 0 ; err_dev_reg: -kfree (&b47s->mtd); +kfree (b47s); out:return err; }
Signature · 1 line
1.8.1.2
Hi David,
what do you think of this patch ?
Quoted 23 lines · On 2013/5/5 16:40, [email protected] wrote:
From: Libo Chen <[email protected]>
mtd is just member of bcm47xxsflash, so we should free bcm47xxsflash not its member.
Signed-off-by Libo Chen <[email protected]>--- drivers/mtd/devices/bcm47xxsflash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)drivers/mtd/devices/bcm47xxsflash.c +1
-1@@ -76,7 +76,7 @@ static int bcm47xxsflash_bcma_probe(struct platform_device *pdev)return 0 ; err_dev_reg: -kfree (&b47s->mtd); +kfree (b47s); out:return err; }
PATCH RESEND 1/1 mtd: fix kfree bcm47xxsflash
In reply to [email protected]mtd is just member of bcm47xxsflash, so we should free bcm47xxsflash not its member.
--- drivers/mtd/devices/bcm47xxsflash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
* add Acked-by: Rafał Miłecki <[email protected]>
* change send list
drivers/mtd/devices/bcm47xxsflash.c +1 -1
@@ -76,7 +76,7 @@ static int bcm47xxsflash_bcma_probe(struct platform_device *pdev)return 0 ; err_dev_reg: -kfree (&b47s->mtd); +kfree (b47s); out:return err; }
Signature · 1 line
1.8.1.2
2013/5/22 Libo Chen <[email protected]>:
Quoted 1 line
mtd is just member of bcm47xxsflash, so we should free bcm47xxsflash not its member.
Thanks!
Signature · 1 line
Rafał
ping...
Quoted 26 lines · Libo Chen
mtd is just member of bcm47xxsflash, so we should free bcm47xxsflash not its member.
Signed-off-by Libo Chen <[email protected]>Acked-by Rafał Miłecki <[email protected]>--- drivers/mtd/devices/bcm47xxsflash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)* add Acked-by: Rafał Miłecki <[email protected]>
* change send listdrivers/mtd/devices/bcm47xxsflash.c +1
-1@@ -76,7 +76,7 @@ static int bcm47xxsflash_bcma_probe(struct platform_device *pdev)return 0 ; err_dev_reg: -kfree (&b47s->mtd); +kfree (b47s); out:return err; }
2013/5/28 Libo Chen <[email protected]>:
Quoted 1 line
ping...
It takes a lot of time for someone to pick up mtd patches, just be patient ;)
Signature · 1 line
Rafał
This is good fix, but I rather prefer not to see it in this shape. See comments below.
Quoted 17 lines · Libo Chen
mtd is just member of bcm47xxsflash, so we should free bcm47xxsflash not its member.
Signed-off-by Libo Chen <[email protected]>Acked-by Rafał Miłecki <[email protected]>--- drivers/mtd/devices/bcm47xxsflash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)* add Acked-by: Rafał Miłecki <[email protected]>
* change send listdrivers/mtd/devices/bcm47xxsflash.c +0
-0
drivers/mtd/devices/bcm47xxsflash.c static int bcm47xxsflash_bcma_probe(struct platform_device *pdev) · line 82
Quoted 8 lines
drivers/mtd/devices/bcm47xxsflash.c +1
-1@@ -76,7 +76,7 @@ static int bcm47xxsflash_bcma_probe(struct platform_device *pdev)return 0 ; err_dev_reg: -kfree (&b47s->mtd); +kfree (b47s); out:return err; }
What about to switch to devm_* and remove those labels and kfrees at all?
Additionally you can add another patch to use module_platform_driver() macro instead of module_init/exit.
--
With Best Regards,
Andy Shevchenko
Quoted 32 lines · Andy Shevchenko
This is good fix, but I rather prefer not to see it in this shape. See comments below.
Quoted 17 lines · Libo Chen
mtd is just member of bcm47xxsflash, so we should free bcm47xxsflash not its member.
Signed-off-by Libo Chen <[email protected]>Acked-by Rafał Miłecki <[email protected]>--- drivers/mtd/devices/bcm47xxsflash.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)* add Acked-by: Rafał Miłecki <[email protected]>
* change send listdrivers/mtd/devices/bcm47xxsflash.c +0
-0drivers/mtd/devices/bcm47xxsflash.c static int bcm47xxsflash_bcma_probe(struct platform_device *pdev) · line 82
Quoted 8 lines
drivers/mtd/devices/bcm47xxsflash.c +1
-1@@ -76,7 +76,7 @@ static int bcm47xxsflash_bcma_probe(struct platform_device *pdev)return 0 ; err_dev_reg: -kfree (&b47s->mtd); +kfree (b47s); out:return err; }What about to switch to devm_* and remove those labels and kfrees at all?
Quoted 3 lines
Additionally you can add another patch to use
module_platform_driver()macro instead of module_init/exit.
ok, I will update later.
thanks,
Libo
Quoted 6 lines
--
With Best Regards,
Andy Shevchenko.