Skip to content

Commit

Permalink
driver core: firmware_class: replace kfree(dev) with put_device(dev)
Browse files Browse the repository at this point in the history
against v2.6.30-rc3-next tree.

Signed-off-by: Ming Lei <tom.leiming@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
  • Loading branch information
ming1 authored and gregkh committed Jun 16, 2009
1 parent 557411e commit 6acf70f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions drivers/base/firmware_class.c
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,7 @@ static void fw_dev_release(struct device *dev)
__free_page(fw_priv->pages[i]);
kfree(fw_priv->pages);
kfree(fw_priv);
kfree(dev);
put_device(dev);

module_put(THIS_MODULE);
}
Expand Down Expand Up @@ -400,14 +400,16 @@ static int fw_register_device(struct device **dev_p, const char *fw_name,
retval = device_register(f_dev);
if (retval) {
dev_err(device, "%s: device_register failed\n", __func__);
goto error_kfree;
put_device(f_dev);
goto error_kfree1;
}
*dev_p = f_dev;
return 0;

error_kfree:
kfree(fw_priv);
kfree(f_dev);
error_kfree1:
kfree(fw_priv);
return retval;
}

Expand Down

0 comments on commit 6acf70f

Please sign in to comment.