From 735d5661d5c5f023a78fbe68e771e261040ff1b7 Mon Sep 17 00:00:00 2001 From: Jesper Juhl Date: Mon, 7 Nov 2005 01:01:29 -0800 Subject: [PATCH] kfree cleanup: drivers/char This is the drivers/char/ part of the big kfree cleanup patch. Remove pointless checks for NULL prior to calling kfree() in drivers/char/. Signed-off-by: Jesper Juhl Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- drivers/char/drm/ffb_context.c | 6 ++---- drivers/char/drm/ffb_drv.c | 6 ++---- 2 files changed, 4 insertions(+), 8 deletions(-) (limited to 'drivers/char/drm') diff --git a/drivers/char/drm/ffb_context.c b/drivers/char/drm/ffb_context.c index 8a6cc2751bc..1383727b443 100644 --- a/drivers/char/drm/ffb_context.c +++ b/drivers/char/drm/ffb_context.c @@ -526,10 +526,8 @@ int ffb_driver_rmctx(struct inode *inode, struct file *filp, unsigned int cmd, if (idx < 0 || idx >= FFB_MAX_CTXS) return -EINVAL; - if (fpriv->hw_state[idx] != NULL) { - kfree(fpriv->hw_state[idx]); - fpriv->hw_state[idx] = NULL; - } + kfree(fpriv->hw_state[idx]); + fpriv->hw_state[idx] = NULL; return 0; } diff --git a/drivers/char/drm/ffb_drv.c b/drivers/char/drm/ffb_drv.c index 5c121d6df9f..c13f9abb41e 100644 --- a/drivers/char/drm/ffb_drv.c +++ b/drivers/char/drm/ffb_drv.c @@ -245,14 +245,12 @@ static void ffb_driver_release(drm_device_t * dev, struct file *filp) static void ffb_driver_pretakedown(drm_device_t * dev) { - if (dev->dev_private) - kfree(dev->dev_private); + kfree(dev->dev_private); } static int ffb_driver_postcleanup(drm_device_t * dev) { - if (ffb_position != NULL) - kfree(ffb_position); + kfree(ffb_position); return 0; } -- cgit v1.2.3