Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/sparc-2.6
[linux-2.6-block.git] / drivers / scsi / ses.c
index 1d7a8780e00cda01248a1854fe1e77c88c7f6d67..0d9d6f7567f5a60352b5462fd48c056c279a191e 100644 (file)
@@ -595,8 +595,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 +606,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;