Bug 200519 - Missing check of the return value of devm_clk_get() in function bcm_get_resources()
Summary: Missing check of the return value of devm_clk_get() in function bcm_get_resou...
Status: RESOLVED PATCH_ALREADY_AVAILABLE
Alias: None
Product: Drivers
Classification: Unclassified
Component: Bluetooth (show other bugs)
Hardware: All Linux
: P1 normal
Assignee: linux-bluetooth@vger.kernel.org
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-07-17 08:04 UTC by Jason Wood
Modified: 2018-09-13 10:40 UTC (History)
0 users

See Also:
Kernel Version: v4.18-rc4
Subsystem:
Regression: No
Bisected commit-id:


Attachments

Description Jason Wood 2018-07-17 08:04:25 UTC
Function bcm_get_resources() defined in drivers/bluetooth/hci_bcm.c calls devm_clk_get() which may return ERR_PTR(-ENOMEM). However, bcm_get_resources() misses the return value check of devm_clk_get(). Codes related to this bug are shown as follows.

drivers/bluetooth/hci_bcm.c:
  906  		return 0;
  907  
  908: 	dev->clk = devm_clk_get(dev->dev, NULL);
  909  
  910  	dev->device_wakeup = devm_gpiod_get_optional(dev->dev, "device-wakeup",
  911						     GPIOD_OUT_LOW);
Comment 1 Jason Wood 2018-09-13 10:40:42 UTC
We have sent the patch to the developers. Currently, we're formatting the patch according to the Linux development documentation.

Note You need to log in before you can comment on or make changes to this bug.