qtnfmac: Missing platform_device_unregister() on error in qtnf_core_mac_alloc()
Subsystems (3)
PATCH 1/1 qtnfmac: Missing platform_device_unregister() on error in qtnf_core_mac_alloc()
Add the missing platform_device_unregister() before return from qtnf_core_mac_alloc() in the error handling case.
Fixes 616f5701f4ab ("qtnfmac: assign each wiphy to its own virtual platform device")
Reported-by Hulk Robot <[email protected]>
Signed-off-by Wang Hai <[email protected]>
--- drivers/net/wireless/quantenna/qtnfmac/core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
drivers/net/wireless/quantenna/qtnfmac/core.c +4 -1
@@ -446,8 +446,11 @@ static struct qtnf_wmac *qtnf_core_mac_alloc(struct qtnf_bus *bus, } wiphy =qtnf_wiphy_allocate (bus, pdev); -if (!wiphy) +if (!wiphy) { +if (pdev) +platform_device_unregister (pdev);return ERR_PTR (-ENOMEM ); + } mac =wiphy_priv (wiphy);
Signature · 1 line
2.17.1
Quoted 16 lines
Add the missing
platform_device_unregister()before return fromqtnf_core_mac_alloc()in the error handling case.Fixes 616f5701f4ab ("qtnfmac: assign each wiphy to its own virtual platform device")Reported-by Hulk Robot <[email protected]>Signed-off-by Wang Hai <[email protected]>--- drivers/net/wireless/quantenna/qtnfmac/core.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)drivers/net/wireless/quantenna/qtnfmac/core.c +0
-0@@ -446,8 +446,11 @@ static struct qtnf_wmac *qtnf_core_mac_alloc(struct qtnf_bus *bus, }
drivers/net/wireless/quantenna/qtnfmac/core.c static struct qtnf_wmac *qtnf_core_mac_alloc(struct qtnf_bus *bus, · line 455
Quoted 10 lines
drivers/net/wireless/quantenna/qtnfmac/core.c +4
-1wiphy =qtnf_wiphy_allocate (bus, pdev); -if (!wiphy) +if (!wiphy) { +if (pdev) +platform_device_unregister (pdev);return ERR_PTR (-ENOMEM ); + } mac =wiphy_priv (wiphy);
Reviewed-by Sergey Matyukevich <[email protected]>
Thanks,
Sergey
Quoted 7 lines · Wang Hai
Add the missing
platform_device_unregister()before return fromqtnf_core_mac_alloc()in the error handling case.Fixes 616f5701f4ab ("qtnfmac: assign each wiphy to its own virtual platform device")Reported-by Hulk Robot <[email protected]>Signed-off-by Wang Hai <[email protected]>Reviewed-by Sergey Matyukevich <[email protected]>
Patch applied to wireless-drivers-next.git, thanks.
141bc9abbbff qtnfmac: Missing platform_device_unregister() on error in qtnf_core_mac_alloc()
Signature · 3 lines
https://patchwork.kernel.org/patch/11692387/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches