mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 03:01:39 -04:00
[PATCH] kfree cleanup: misc remaining drivers
This is the remaining misc drivers/ part of the big kfree cleanup patch. Remove pointless checks for NULL prior to calling kfree() in misc files in drivers/. Signed-off-by: Jesper Juhl <[email protected]> Acked-by: Aristeu Sergio Rozanski Filho <[email protected]> Acked-by: Roland Dreier <[email protected]> Acked-by: Pierre Ossman <[email protected]> Acked-by: Jean Delvare <[email protected]> Acked-by: Greg Kroah-Hartman <[email protected]> Acked-by: Len Brown <[email protected]> Acked-by: "Antonino A. Daplas" <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
This commit is contained in:
parent
2ea7533060
commit
6044ec8882
24 changed files with 83 additions and 151 deletions
|
|
@ -3292,12 +3292,9 @@ static void ide_cd_release(struct kref *kref)
|
|||
ide_drive_t *drive = info->drive;
|
||||
struct gendisk *g = info->disk;
|
||||
|
||||
if (info->buffer != NULL)
|
||||
kfree(info->buffer);
|
||||
if (info->toc != NULL)
|
||||
kfree(info->toc);
|
||||
if (info->changer_info != NULL)
|
||||
kfree(info->changer_info);
|
||||
kfree(info->buffer);
|
||||
kfree(info->toc);
|
||||
kfree(info->changer_info);
|
||||
if (devinfo->handle == drive && unregister_cdrom(devinfo))
|
||||
printk(KERN_ERR "%s: %s failed to unregister device from the cdrom "
|
||||
"driver.\n", __FUNCTION__, drive->name);
|
||||
|
|
@ -3487,12 +3484,9 @@ static int ide_cd_probe(struct device *dev)
|
|||
if (ide_cdrom_setup(drive)) {
|
||||
struct cdrom_device_info *devinfo = &info->devinfo;
|
||||
ide_unregister_subdriver(drive, &ide_cdrom_driver);
|
||||
if (info->buffer != NULL)
|
||||
kfree(info->buffer);
|
||||
if (info->toc != NULL)
|
||||
kfree(info->toc);
|
||||
if (info->changer_info != NULL)
|
||||
kfree(info->changer_info);
|
||||
kfree(info->buffer);
|
||||
kfree(info->toc);
|
||||
kfree(info->changer_info);
|
||||
if (devinfo->handle == drive && unregister_cdrom(devinfo))
|
||||
printk (KERN_ERR "%s: ide_cdrom_cleanup failed to unregister device from the cdrom driver.\n", drive->name);
|
||||
kfree(info);
|
||||
|
|
|
|||
|
|
@ -1315,10 +1315,8 @@ static void drive_release_dev (struct device *dev)
|
|||
drive->devfs_name[0] = '\0';
|
||||
}
|
||||
ide_remove_drive_from_hwgroup(drive);
|
||||
if (drive->id != NULL) {
|
||||
kfree(drive->id);
|
||||
drive->id = NULL;
|
||||
}
|
||||
kfree(drive->id);
|
||||
drive->id = NULL;
|
||||
drive->present = 0;
|
||||
/* Messed up locking ... */
|
||||
spin_unlock_irq(&ide_lock);
|
||||
|
|
|
|||
|
|
@ -646,10 +646,8 @@ int ide_taskfile_ioctl (ide_drive_t *drive, unsigned int cmd, unsigned long arg)
|
|||
}
|
||||
abort:
|
||||
kfree(req_task);
|
||||
if (outbuf != NULL)
|
||||
kfree(outbuf);
|
||||
if (inbuf != NULL)
|
||||
kfree(inbuf);
|
||||
kfree(outbuf);
|
||||
kfree(inbuf);
|
||||
|
||||
// printk("IDE Taskfile ioctl ended. rc = %i\n", err);
|
||||
|
||||
|
|
|
|||
|
|
@ -888,8 +888,7 @@ static int __ide_add_setting(ide_drive_t *drive, const char *name, int rw, int r
|
|||
return 0;
|
||||
abort:
|
||||
up(&ide_setting_sem);
|
||||
if (setting)
|
||||
kfree(setting);
|
||||
kfree(setting);
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue