ACPI: catch calls of acpi_driver_data on pointer of wrong type
Catch attempts to use of acpi_driver_data on pointers of wrong type. akpm: rewritten to use proper C typechecking and remove the "function"-used-as-lvalue thing. Signed-off-by: Pavel Machek <pavel@suse.cz> Signed-off-by: Andrew Morton <akpm@linux-foundation.org> Signed-off-by: Len Brown <len.brown@intel.com>
This commit is contained in:
@ -1491,7 +1491,7 @@ acpi_video_bus_get_one_device(struct acpi_device *device,
|
||||
|
||||
strcpy(acpi_device_name(device), ACPI_VIDEO_DEVICE_NAME);
|
||||
strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS);
|
||||
acpi_driver_data(device) = data;
|
||||
device->driver_data = data;
|
||||
|
||||
data->device_id = device_id;
|
||||
data->video = video;
|
||||
@ -1982,7 +1982,7 @@ static int acpi_video_bus_add(struct acpi_device *device)
|
||||
video->device = device;
|
||||
strcpy(acpi_device_name(device), ACPI_VIDEO_BUS_NAME);
|
||||
strcpy(acpi_device_class(device), ACPI_VIDEO_CLASS);
|
||||
acpi_driver_data(device) = video;
|
||||
device->driver_data = video;
|
||||
|
||||
acpi_video_bus_find_cap(video);
|
||||
error = acpi_video_bus_check(video);
|
||||
@ -2058,7 +2058,7 @@ static int acpi_video_bus_add(struct acpi_device *device)
|
||||
acpi_video_bus_remove_fs(device);
|
||||
err_free_video:
|
||||
kfree(video);
|
||||
acpi_driver_data(device) = NULL;
|
||||
device->driver_data = NULL;
|
||||
|
||||
return error;
|
||||
}
|
||||
|
Reference in New Issue
Block a user