]> bbs.cooldavid.org Git - net-next-2.6.git/blobdiff - drivers/scsi/ses.c
include cleanup: Update gfp.h and slab.h includes to prepare for breaking implicit...
[net-next-2.6.git] / drivers / scsi / ses.c
index 1d7a8780e00cda01248a1854fe1e77c88c7f6d67..7f5a6a86f820fbae8baee63e7de722b480c96462 100644 (file)
@@ -21,6 +21,7 @@
 **-----------------------------------------------------------------------------
 */
 
+#include <linux/slab.h>
 #include <linux/module.h>
 #include <linux/kernel.h>
 #include <linux/enclosure.h>
@@ -595,8 +596,6 @@ static int ses_intf_add(struct device *cdev,
                ses_dev->page10_len = len;
                buf = NULL;
        }
-       kfree(hdr_buf);
-
        scomp = kzalloc(sizeof(struct ses_component) * components, GFP_KERNEL);
        if (!scomp)
                goto err_free;
@@ -608,6 +607,8 @@ static int ses_intf_add(struct device *cdev,
                goto err_free;
        }
 
+       kfree(hdr_buf);
+
        edev->scratch = ses_dev;
        for (i = 0; i < components; i++)
                edev->component[i].scratch = scomp + i;