Gitweb:     
http://git.kernel.org/git/?p=linux/kernel/git/torvalds/linux-2.6.git;a=commit;h=5a9df732b6a547aa843e8655044db9573d7b4e71
Commit:     5a9df732b6a547aa843e8655044db9573d7b4e71
Parent:     b012d346c0e914f505d92f730ad1758f73e2953b
Author:     Adrian Bunk <[EMAIL PROTECTED]>
AuthorDate: Tue Oct 16 23:29:26 2007 -0700
Committer:  Linus Torvalds <[EMAIL PROTECTED]>
CommitDate: Wed Oct 17 08:42:55 2007 -0700

    drivers/block/cciss.c: fix check-after-use
    
    The Coverity checker spotted that we have already oops'ed if "disk"
    was NULL.
    
    Since "disk" being NULL seems impossible at this point this patch
    removes the NULL check.
    
    Signed-off-by: Adrian Bunk <[EMAIL PROTECTED]>
    Acked-by: Mike Miller <[EMAIL PROTECTED]>
    Signed-off-by: Andrew Morton <[EMAIL PROTECTED]>
    Signed-off-by: Linus Torvalds <[EMAIL PROTECTED]>
---
 drivers/block/cciss.c |   56 +++++++++++++++++++++++-------------------------
 1 files changed, 27 insertions(+), 29 deletions(-)

diff --git a/drivers/block/cciss.c b/drivers/block/cciss.c
index 5c269c0..ca56a0e 100644
--- a/drivers/block/cciss.c
+++ b/drivers/block/cciss.c
@@ -1582,38 +1582,36 @@ static int deregister_disk(struct gendisk *disk, 
drive_info_struct *drv,
         * allows us to delete disk zero but keep the controller registered.
         */
        if (h->gendisk[0] != disk) {
-               if (disk) {
-                       struct request_queue *q = disk->queue;
-                       if (disk->flags & GENHD_FL_UP)
-                               del_gendisk(disk);
-                       if (q) {
-                               blk_cleanup_queue(q);
-                               /* Set drv->queue to NULL so that we do not try
-                                * to call blk_start_queue on this queue in the
-                                * interrupt handler
-                                */
-                               drv->queue = NULL;
-                       }
-                       /* If clear_all is set then we are deleting the logical
-                        * drive, not just refreshing its info.  For drives
-                        * other than disk 0 we will call put_disk.  We do not
-                        * do this for disk 0 as we need it to be able to
-                        * configure the controller.
+               struct request_queue *q = disk->queue;
+               if (disk->flags & GENHD_FL_UP)
+                       del_gendisk(disk);
+               if (q) {
+                       blk_cleanup_queue(q);
+                       /* Set drv->queue to NULL so that we do not try
+                        * to call blk_start_queue on this queue in the
+                        * interrupt handler
+                        */
+                       drv->queue = NULL;
+               }
+               /* If clear_all is set then we are deleting the logical
+                * drive, not just refreshing its info.  For drives
+                * other than disk 0 we will call put_disk.  We do not
+                * do this for disk 0 as we need it to be able to
+                * configure the controller.
+               */
+               if (clear_all){
+                       /* This isn't pretty, but we need to find the
+                        * disk in our array and NULL our the pointer.
+                        * This is so that we will call alloc_disk if
+                        * this index is used again later.
                        */
-                       if (clear_all){
-                               /* This isn't pretty, but we need to find the
-                                * disk in our array and NULL our the pointer.
-                                * This is so that we will call alloc_disk if
-                                * this index is used again later.
-                               */
-                               for (i=0; i < CISS_MAX_LUN; i++){
-                                       if(h->gendisk[i] == disk){
-                                               h->gendisk[i] = NULL;
-                                               break;
-                                       }
+                       for (i=0; i < CISS_MAX_LUN; i++){
+                               if(h->gendisk[i] == disk){
+                                       h->gendisk[i] = NULL;
+                                       break;
                                }
-                               put_disk(disk);
                        }
+                       put_disk(disk);
                }
        } else {
                set_capacity(disk, 0);
-
To unsubscribe from this list: send the line "unsubscribe git-commits-head" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to