Showing error 1786

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


Source:

2029        while (in_index != pp->resp_idx) {
2030                unsigned int tag;
2031                struct mv_crpb *response = &pp->crpb[pp->resp_idx];
2032
2033                pp->resp_idx = (pp->resp_idx + 1) & MV_MAX_Q_DEPTH_MASK;
2034
2035                if (IS_GEN_I(hpriv)) {
2036                        /* 50xx: no NCQ, only one command active at a time */
2037                        tag = ap->link.active_tag;
2038                } else {
2039                        /* Gen II/IIE: get command tag from CRPB entry */
2040                        tag = le16_to_cpu(response->id) & 0x1f;
2041                }
2042                mv_process_crpb_response(ap, response, tag, ncq_enabled);
2043                work_done = true;
2044        }
2045
2046        /* Update the software queue position index in hardware */
2047        if (work_done)
2048                writelfl((pp->crpb_dma & EDMA_RSP_Q_BASE_LO_MASK) |
2049                         (pp->resp_idx << EDMA_RSP_Q_PTR_SHIFT),
2050                         port_mmio + EDMA_RSP_Q_OUT_PTR_OFS);
2051}
2052
2053static void mv_port_intr(struct ata_port *ap, u32 port_cause)
2054{
2055        struct mv_port_priv *pp;
2056        int edma_was_enabled;
2057
2058        if (!ap || (ap->flags & ATA_FLAG_DISABLED)) {
2059                mv_unexpected_intr(ap, 0);
2060                return;
2061        }
2062        /*
2063         * Grab a snapshot of the EDMA_EN flag setting,
2064         * so that we have a consistent view for this port,
2065         * even if something we call of our routines changes it.
2066         */
2067        pp = ap->private_data;
2068        edma_was_enabled = (pp->pp_flags & MV_PP_FLAG_EDMA_EN);
2069        /*
Show full sources