mirror of
https://github.com/torvalds/linux.git
synced 2026-06-09 15:12:59 +02:00
net: rfkill: fixed "WARNING: invalid free of devm_ allocated data"
Change-Id: I3c84a08e9d62d6f16e4f162708584f7fd716066b Signed-off-by: xiaoyao <xiaoyao@rock-chips.com>
This commit is contained in:
parent
01e482c2d7
commit
68874647f2
|
|
@ -573,10 +573,8 @@ static int rfkill_rk_probe(struct platform_device *pdev)
|
|||
pdata->type = RFKILL_TYPE_BLUETOOTH;
|
||||
|
||||
rfkill = devm_kzalloc(&pdev->dev, sizeof(*rfkill), GFP_KERNEL);
|
||||
if (!rfkill) {
|
||||
kfree(pdata);
|
||||
if (!rfkill)
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
rfkill->pdata = pdata;
|
||||
rfkill->pdev = pdev;
|
||||
|
|
@ -705,7 +703,6 @@ static int rfkill_rk_remove(struct platform_device *pdev)
|
|||
if (gpio_is_valid(rfkill->pdata->poweron_gpio.io))
|
||||
gpio_free(rfkill->pdata->poweron_gpio.io);
|
||||
|
||||
kfree(rfkill);
|
||||
g_rfkill = NULL;
|
||||
|
||||
return 0;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user