summaryrefslogtreecommitdiff
path: root/drivers/cdrom/cdrom.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/cdrom/cdrom.c')
-rw-r--r--drivers/cdrom/cdrom.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c
index 31ba1f8c1f78..fe0f633bc655 100644
--- a/drivers/cdrom/cdrom.c
+++ b/drivers/cdrom/cdrom.c
@@ -1318,7 +1318,7 @@ static int cdrom_slot_status(struct cdrom_device_info *cdi, int slot)
if (cdi->sanyo_slot)
return CDS_NO_INFO;
- info = kmalloc(sizeof(*info), GFP_KERNEL);
+ info = kmalloc_obj(*info, GFP_KERNEL);
if (!info)
return -ENOMEM;
@@ -1347,7 +1347,7 @@ int cdrom_number_of_slots(struct cdrom_device_info *cdi)
/* cdrom_read_mech_status requires a valid value for capacity: */
cdi->capacity = 0;
- info = kmalloc(sizeof(*info), GFP_KERNEL);
+ info = kmalloc_obj(*info, GFP_KERNEL);
if (!info)
return -ENOMEM;
@@ -1406,7 +1406,7 @@ static int cdrom_select_disc(struct cdrom_device_info *cdi, int slot)
return cdrom_load_unload(cdi, -1);
}
- info = kmalloc(sizeof(*info), GFP_KERNEL);
+ info = kmalloc_obj(*info, GFP_KERNEL);
if (!info)
return -ENOMEM;
@@ -2311,7 +2311,7 @@ static int cdrom_ioctl_media_changed(struct cdrom_device_info *cdi,
/* Prevent arg from speculatively bypassing the length check */
arg = array_index_nospec(arg, cdi->capacity);
- info = kmalloc(sizeof(*info), GFP_KERNEL);
+ info = kmalloc_obj(*info, GFP_KERNEL);
if (!info)
return -ENOMEM;