[alsa-devel] [bug report] soundwire: intel: Add Intel init module
Hello Vinod Koul,
The patch d62a7d41f38e: "soundwire: intel: Add Intel init module" from Dec 14, 2017, leads to the following static checker warning:
drivers/soundwire/intel_init.c:154 sdw_intel_acpi_cb() error: uninitialized symbol 'adev'.
drivers/soundwire/intel_init.c 147 static acpi_status sdw_intel_acpi_cb(acpi_handle handle, u32 level, 148 void *cdata, void **return_value) 149 { 150 struct sdw_intel_res *res = cdata; 151 struct acpi_device *adev; 152 153 if (acpi_bus_get_device(handle, &adev)) { 154 dev_err(&adev->dev, "Couldn't find ACPI handle\n"); 155 return AE_NOT_FOUND;
We can't dereference "adev" if the acpi_bus_get_device() fails.
156 } 157 158 res->handle = handle; 159 return AE_OK; 160 }
Related: drivers/acpi/scan.c:2008 acpi_walk_dep_device_list() error: uninitialized symbol 'adev'. drivers/usb/core/usb-acpi.c:204 usb_acpi_find_companion() error: uninitialized symbol 'adev'.
regards, dan carpenter
On 8/6/18 3:55 AM, Dan Carpenter wrote:
Hello Vinod Koul,
The patch d62a7d41f38e: "soundwire: intel: Add Intel init module" from Dec 14, 2017, leads to the following static checker warning:
drivers/soundwire/intel_init.c:154 sdw_intel_acpi_cb() error: uninitialized symbol 'adev'.
drivers/soundwire/intel_init.c 147 static acpi_status sdw_intel_acpi_cb(acpi_handle handle, u32 level, 148 void *cdata, void **return_value) 149 { 150 struct sdw_intel_res *res = cdata; 151 struct acpi_device *adev; 152 153 if (acpi_bus_get_device(handle, &adev)) { 154 dev_err(&adev->dev, "Couldn't find ACPI handle\n"); 155 return AE_NOT_FOUND;
We can't dereference "adev" if the acpi_bus_get_device() fails.
Might as well remove the error log, it's not very useful?
156 } 157 158 res->handle = handle; 159 return AE_OK; 160 }
Related: drivers/acpi/scan.c:2008 acpi_walk_dep_device_list() error: uninitialized symbol 'adev'. drivers/usb/core/usb-acpi.c:204 usb_acpi_find_companion() error: uninitialized symbol 'adev'.
regards, dan carpenter _______________________________________________ Alsa-devel mailing list Alsa-devel@alsa-project.org http://mailman.alsa-project.org/mailman/listinfo/alsa-devel
On 06-08-18, 08:57, Pierre-Louis Bossart wrote:
On 8/6/18 3:55 AM, Dan Carpenter wrote:
Hello Vinod Koul,
The patch d62a7d41f38e: "soundwire: intel: Add Intel init module" from Dec 14, 2017, leads to the following static checker warning:
drivers/soundwire/intel_init.c:154 sdw_intel_acpi_cb() error: uninitialized symbol 'adev'.
drivers/soundwire/intel_init.c 147 static acpi_status sdw_intel_acpi_cb(acpi_handle handle, u32 level, 148 void *cdata, void **return_value) 149 { 150 struct sdw_intel_res *res = cdata; 151 struct acpi_device *adev; 152 153 if (acpi_bus_get_device(handle, &adev)) { 154 dev_err(&adev->dev, "Couldn't find ACPI handle\n"); 155 return AE_NOT_FOUND;
We can't dereference "adev" if the acpi_bus_get_device() fails.
Might as well remove the error log, it's not very useful?
Or make it pr_err, will cook a patch ;-). I think for debug it is very useful as one might have erroneously set the ACPI handle
participants (3)
-
Dan Carpenter
-
Pierre-Louis Bossart
-
Vinod