Showing error 1854

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


Source:

871                return USB_STOR_TRANSPORT_GOOD;
872
873        }
874
875        if (srb->cmnd[0] == READ_10 || srb->cmnd[0] == WRITE_10) {
876
877                page = short_pack(srb->cmnd[3], srb->cmnd[2]);
878                page <<= 16;
879                page |= short_pack(srb->cmnd[5], srb->cmnd[4]);
880                pages = short_pack(srb->cmnd[8], srb->cmnd[7]);
881
882                page <<= info->smallpageshift;
883
884                // convert page to block and page-within-block
885
886                lba = page >> info->blockshift;
887                page = page & info->blockmask;
888
889                // locate physical block corresponding to logical block
890
891                if (lba >= info->max_log_blks) {
892
893                        US_DEBUGP("Error: Requested LBA %04X exceeds maximum "
894                          "block %04X\n", lba, info->max_log_blks-1);
895
896                        set_sense_info (5, 0x24, 0);        /* invalid field in command */
897
898                        return USB_STOR_TRANSPORT_FAILED;
899                }
900
901                pba = info->lba_to_pba[lba];
902
903                if (srb->cmnd[0] == WRITE_10) {
904                        US_DEBUGP("WRITE_10: write block %04X (LBA %04X) page %01X"
905                                " pages %d\n",
906                                pba, lba, page, pages);
907
908                        return sddr55_write_data(us, lba, page, pages);
909                } else {
910                        US_DEBUGP("READ_10: read block %04X (LBA %04X) page %01X"
911                                " pages %d\n",
Show full sources