]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - drivers/message/fusion/mptsas.c
Pull virt-cpu-accounting into release branch
[linux-2.6-omap-h63xx.git] / drivers / message / fusion / mptsas.c
index e4c94f93de16a98462518419c923bb24f24d9414..78734e25edd515bcc863fbcae3216c6447e045eb 100644 (file)
@@ -1343,6 +1343,8 @@ static int mptsas_smp_handler(struct Scsi_Host *shost, struct sas_rphy *rphy,
                smprep = (SmpPassthroughReply_t *)ioc->sas_mgmt.reply;
                memcpy(req->sense, smprep, sizeof(*smprep));
                req->sense_len = sizeof(*smprep);
+               req->data_len = 0;
+               rsp->data_len -= smprep->ResponseDataLength;
        } else {
                printk(MYIOC_s_ERR_FMT "%s: smp passthru reply failed to be returned\n",
                    ioc->name, __FUNCTION__);
@@ -1699,6 +1701,11 @@ mptsas_sas_expander_pg0(MPT_ADAPTER *ioc, struct mptsas_portinfo *port_info,
        if (error)
                goto out_free_consistent;
 
+       if (!buffer->NumPhys) {
+               error = -ENODEV;
+               goto out_free_consistent;
+       }
+
        /* save config data */
        port_info->num_phys = buffer->NumPhys;
        port_info->phy_info = kcalloc(port_info->num_phys,