Showing error 1846

User: Jiri Slaby
Error type: Invalid Pointer Dereference
Error type description: A pointer which is invalid is being dereferenced
File location: drivers/scsi/megaraid/megaraid_sas.c
Line in file: 1397
Project: Linux Kernel
Project version: 2.6.28
Tools: Smatch (1.59)
Entered: 2013-09-11 08:47:26 UTC


Source:

1367static void
1368megasas_complete_cmd(struct megasas_instance *instance, struct megasas_cmd *cmd,
1369                     u8 alt_status)
1370{
1371        int exception = 0;
1372        struct megasas_header *hdr = &cmd->frame->hdr;
1373
1374        if (cmd->scmd)
1375                cmd->scmd->SCp.ptr = NULL;
1376
1377        switch (hdr->cmd) {
1378
1379        case MFI_CMD_PD_SCSI_IO:
1380        case MFI_CMD_LD_SCSI_IO:
1381
1382                /*
1383                 * MFI_CMD_PD_SCSI_IO and MFI_CMD_LD_SCSI_IO could have been
1384                 * issued either through an IO path or an IOCTL path. If it
1385                 * was via IOCTL, we will send it to internal completion.
1386                 */
1387                if (cmd->sync_cmd) {
1388                        cmd->sync_cmd = 0;
1389                        megasas_complete_int_cmd(instance, cmd);
1390                        break;
1391                }
1392
1393        case MFI_CMD_LD_READ:
1394        case MFI_CMD_LD_WRITE:
1395
1396                if (alt_status) {
1397                        cmd->scmd->result = alt_status << 16;
1398                        exception = 1;
1399                }
1400
1401                if (exception) {
1402
1403                        atomic_dec(&instance->fw_outstanding);
1404
1405                        scsi_dma_unmap(cmd->scmd);
1406                        cmd->scmd->scsi_done(cmd->scmd);
1407                        megasas_return_cmd(instance, cmd);
Show full sources