]> git.proxmox.com Git - mirror_ubuntu-hirsute-kernel.git/commitdiff
staging: slicoss: error handling with goto
authorKulikov Vasiliy <segooon@gmail.com>
Sun, 27 Jun 2010 13:20:46 +0000 (17:20 +0400)
committerGreg Kroah-Hartman <gregkh@suse.de>
Thu, 8 Jul 2010 20:16:43 +0000 (13:16 -0700)
This patch makes error handling more readable due to 'goto err' pattern.

Signed-off-by: Kulikov Vasiliy <segooon@gmail.com>
Cc: Denis Kirjanov <kirjanov@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/staging/slicoss/slicoss.c

index 16cd2cb4d2cc97d966e2ea3b64b6ba2c94414000..51ca17c1f4832e2c5648c8d83d3d1133859c4e6d 100644 (file)
@@ -2646,22 +2646,21 @@ static int slic_upr_request(struct adapter *adapter,
                     u32 upr_data_h,
                     u32 upr_buffer, u32 upr_buffer_h)
 {
-       int status;
+       int rc;
 
        spin_lock_irqsave(&adapter->upr_lock.lock, adapter->upr_lock.flags);
-       status = slic_upr_queue_request(adapter,
+       rc = slic_upr_queue_request(adapter,
                                        upr_request,
                                        upr_data,
                                        upr_data_h, upr_buffer, upr_buffer_h);
-       if (status != 0) {
-               spin_unlock_irqrestore(&adapter->upr_lock.lock,
-                                       adapter->upr_lock.flags);
-               return status;
-       }
+       if (rc)
+               goto err_unlock_irq;
+
        slic_upr_start(adapter);
+err_unlock_irq:
        spin_unlock_irqrestore(&adapter->upr_lock.lock,
                                adapter->upr_lock.flags);
-       return 0;
+       return rc;
 }
 
 static void slic_upr_request_complete(struct adapter *adapter, u32 isr)