]> err.no Git - linux-2.6/commitdiff
[SCSI] ipr: Error logging cleanup
authorbrking@us.ibm.com <brking@us.ibm.com>
Tue, 1 Nov 2005 23:00:47 +0000 (17:00 -0600)
committerJames Bottomley <jejb@mulgrave.(none)>
Sun, 6 Nov 2005 19:01:24 +0000 (13:01 -0600)
Simplify error logging path, sanitize error length returned
by the adapter.

Signed-off-by: Brian King <brking@us.ibm.com>
Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
drivers/scsi/ipr.c

index 40763b64e9eb1fcfd1dfa4702d033e2b2078bffb..b5a2669518bae9decf1ad01ab88f17656b4d8220 100644 (file)
@@ -1141,11 +1141,10 @@ static void ipr_handle_log_data(struct ipr_ioa_cfg *ioa_cfg,
 
        if (ioa_cfg->log_level < IPR_DEFAULT_LOG_LEVEL)
                return;
+       if (be32_to_cpu(hostrcb->hcam.length) > sizeof(hostrcb->hcam.u.raw))
+               hostrcb->hcam.length = cpu_to_be32(sizeof(hostrcb->hcam.u.raw));
 
        switch (hostrcb->hcam.overlay_id) {
-       case IPR_HOST_RCB_OVERLAY_ID_1:
-               ipr_log_generic_error(ioa_cfg, hostrcb);
-               break;
        case IPR_HOST_RCB_OVERLAY_ID_2:
                ipr_log_cache_error(ioa_cfg, hostrcb);
                break;
@@ -1156,6 +1155,7 @@ static void ipr_handle_log_data(struct ipr_ioa_cfg *ioa_cfg,
        case IPR_HOST_RCB_OVERLAY_ID_6:
                ipr_log_array_error(ioa_cfg, hostrcb);
                break;
+       case IPR_HOST_RCB_OVERLAY_ID_1:
        case IPR_HOST_RCB_OVERLAY_ID_DEFAULT:
        default:
                ipr_log_generic_error(ioa_cfg, hostrcb);