Showing error 1841

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


Source:

3224/*                                                                          */
3225/*   Do housekeeping on completed commands                                  */
3226/*  ASSUMED to be called form within the request lock                       */
3227/****************************************************************************/
3228static void
3229ips_done(ips_ha_t * ha, ips_scb_t * scb)
3230{
3231        int ret;
3232
3233        METHOD_TRACE("ips_done", 1);
3234
3235        if (!scb)
3236                return;
3237
3238        if ((scb->scsi_cmd) && (ips_is_passthru(scb->scsi_cmd))) {
3239                ips_cleanup_passthru(ha, scb);
3240                ha->num_ioctl--;
3241        } else {
3242                /*
3243                 * Check to see if this command had too much
3244                 * data and had to be broke up.  If so, queue
3245                 * the rest of the data and continue.
3246                 */
3247                if ((scb->breakup) || (scb->sg_break)) {
3248                        struct scatterlist *sg;
3249                        int i, sg_dma_index, ips_sg_index = 0;
3250
3251                        /* we had a data breakup */
3252                        scb->data_len = 0;
3253
3254                        sg = scsi_sglist(scb->scsi_cmd);
3255
3256                        /* Spin forward to last dma chunk */
3257                        sg_dma_index = scb->breakup;
3258                        for (i = 0; i < scb->breakup; i++)
3259                                sg = sg_next(sg);
3260
3261                        /* Take care of possible partial on last chunk */
3262                        ips_fill_scb_sg_single(ha,
3263                                               sg_dma_address(sg),
3264                                               scb, ips_sg_index++,
Show full sources