Char/Misc driver fixes for 4.4-rc5

Only 2 small fpga driver fixes here, both have been in linux-next for a
 while, and resolve some reported issues.
 
 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
 -----BEGIN PGP SIGNATURE-----
 Version: GnuPG v2
 
 iEYEABECAAYFAlZs8QgACgkQMUfUDdst+ylYnQCfXd9QTIlpJqssNzGZhcgE/CNI
 jRgAoIPkV4HkJjbv5TY15oSvxMjHOUo/
 =NqHx
 -----END PGP SIGNATURE-----

Merge tag 'char-misc-4.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc

Pull fpga driver fixes from Greg KH:
 "Only two small fpga driver fixes here, both have been in linux-next
  for a while, and resolve some reported issues"

* tag 'char-misc-4.4-rc5' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
  fpga manager: Fix firmware resource leak on error
  fpga manager: remove label
This commit is contained in:
Linus Torvalds 2015-12-13 12:29:22 -08:00
commit f17ef4959f

View File

@ -122,12 +122,10 @@ int fpga_mgr_firmware_load(struct fpga_manager *mgr, u32 flags,
} }
ret = fpga_mgr_buf_load(mgr, flags, fw->data, fw->size); ret = fpga_mgr_buf_load(mgr, flags, fw->data, fw->size);
if (ret)
return ret;
release_firmware(fw); release_firmware(fw);
return 0; return ret;
} }
EXPORT_SYMBOL_GPL(fpga_mgr_firmware_load); EXPORT_SYMBOL_GPL(fpga_mgr_firmware_load);
@ -256,7 +254,6 @@ int fpga_mgr_register(struct device *dev, const char *name,
void *priv) void *priv)
{ {
struct fpga_manager *mgr; struct fpga_manager *mgr;
const char *dt_label;
int id, ret; int id, ret;
if (!mops || !mops->write_init || !mops->write || if (!mops || !mops->write_init || !mops->write ||
@ -300,11 +297,9 @@ int fpga_mgr_register(struct device *dev, const char *name,
mgr->dev.id = id; mgr->dev.id = id;
dev_set_drvdata(dev, mgr); dev_set_drvdata(dev, mgr);
dt_label = of_get_property(mgr->dev.of_node, "label", NULL); ret = dev_set_name(&mgr->dev, "fpga%d", id);
if (dt_label) if (ret)
ret = dev_set_name(&mgr->dev, "%s", dt_label); goto error_device;
else
ret = dev_set_name(&mgr->dev, "fpga%d", id);
ret = device_add(&mgr->dev); ret = device_add(&mgr->dev);
if (ret) if (ret)