Signed-off-by: Tomas Henzl <the...@redhat.com>
---
 drivers/scsi/hpsa.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/scsi/hpsa.c b/drivers/scsi/hpsa.c
index af32962259..6e4abba285 100644
--- a/drivers/scsi/hpsa.c
+++ b/drivers/scsi/hpsa.c
@@ -7102,14 +7102,13 @@ static void hpsa_free_device_info(struct ctlr_info *h)
 
 static void hpsa_remove_one(struct pci_dev *pdev)
 {
-       struct ctlr_info *h;
        unsigned long flags;
+       struct ctlr_info *h = pci_get_drvdata(pdev);
 
-       if (pci_get_drvdata(pdev) == NULL) {
+       if (!h) {
                dev_err(&pdev->dev, "unable to remove device\n");
                return;
        }
-       h = pci_get_drvdata(pdev);
 
        /* Get rid of any controller monitoring work items */
        spin_lock_irqsave(&h->lock, flags);
-- 
1.9.3

--
To unsubscribe from this list: send the line "unsubscribe linux-scsi" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to