]> git.karo-electronics.de Git - mv-sheeva.git/blobdiff - drivers/staging/dream/camera/msm_camera.c
include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit...
[mv-sheeva.git] / drivers / staging / dream / camera / msm_camera.c
index 223918f858e7615c18f62d50445fd1d293f1965b..81bd71fd816ee69a56d928b9122dc50fa34fa129 100644 (file)
@@ -12,6 +12,7 @@
 
 #include <linux/kernel.h>
 #include <linux/module.h>
+#include <linux/slab.h>
 #include <linux/init.h>
 #include <linux/sched.h>
 #include <mach/board.h>
@@ -592,8 +593,7 @@ end:
         * a result of a successful completion, we are freeing the qcmd that
         * we dequeued from queue->ctrl_status_q.
         */
-       if (qcmd)
-               kfree(qcmd);
+       kfree(qcmd);
 
        CDBG("msm_control: end rc = %d\n", rc);
        return rc;
@@ -795,8 +795,7 @@ static int msm_get_stats(struct msm_sync *sync, void __user *arg)
        }
 
 failure:
-       if (qcmd)
-               kfree(qcmd);
+       kfree(qcmd);
 
        CDBG("msm_get_stats: %d\n", rc);
        return rc;
@@ -1886,8 +1885,10 @@ static int msm_open_control(struct inode *inode, struct file *filep)
                return -ENOMEM;
 
        rc = msm_open_common(inode, filep, 0);
-       if (rc < 0)
+       if (rc < 0) {
+               kfree(ctrl_pmsm);
                return rc;
+       }
 
        ctrl_pmsm->pmsm = filep->private_data;
        filep->private_data = ctrl_pmsm;
@@ -1930,8 +1931,7 @@ static int __msm_v4l2_control(struct msm_sync *sync,
        memcpy(out->value, ctrl->value, ctrl->length);
 
 end:
-       if (rcmd)
-               kfree(rcmd);
+       kfree(rcmd);
        CDBG("__msm_v4l2_control: end rc = %d\n", rc);
        return rc;
 }