Skip to content

Commit

Permalink
Merge tag 'char-misc-4.4-rc5' of git://git.kernel.org/pub/scm/linux/k…
Browse files Browse the repository at this point in the history
…ernel/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
  • Loading branch information
torvalds committed Dec 13, 2015
2 parents b24f74e + e8c77bd commit f17ef49
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions drivers/fpga/fpga-mgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
if (ret)
return ret;

release_firmware(fw);

return 0;
return ret;
}
EXPORT_SYMBOL_GPL(fpga_mgr_firmware_load);

Expand Down Expand Up @@ -256,7 +254,6 @@ int fpga_mgr_register(struct device *dev, const char *name,
void *priv)
{
struct fpga_manager *mgr;
const char *dt_label;
int id, ret;

if (!mops || !mops->write_init || !mops->write ||
Expand Down Expand Up @@ -300,11 +297,9 @@ int fpga_mgr_register(struct device *dev, const char *name,
mgr->dev.id = id;
dev_set_drvdata(dev, mgr);

dt_label = of_get_property(mgr->dev.of_node, "label", NULL);
if (dt_label)
ret = dev_set_name(&mgr->dev, "%s", dt_label);
else
ret = dev_set_name(&mgr->dev, "fpga%d", id);
ret = dev_set_name(&mgr->dev, "fpga%d", id);
if (ret)
goto error_device;

ret = device_add(&mgr->dev);
if (ret)
Expand Down

0 comments on commit f17ef49

Please sign in to comment.