From patchwork Tue Oct 16 15:00:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Garry X-Patchwork-Id: 148945 Delivered-To: patch@linaro.org Received: by 2002:a2e:8595:0:0:0:0:0 with SMTP id b21-v6csp5198737lji; Tue, 16 Oct 2018 07:58:54 -0700 (PDT) X-Google-Smtp-Source: ACcGV61zxw2v/+U0HIemge3BT3CBIogcQDknEi6Zeptmg/qGHfWXxvkkBWUkE2/uKWlZc/d7GVJs X-Received: by 2002:a17:902:6bc7:: with SMTP id m7-v6mr21481417plt.274.1539701933908; Tue, 16 Oct 2018 07:58:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539701933; cv=none; d=google.com; s=arc-20160816; b=Q2jlmqATC+ZQkOKFgTM7q/wM7Qy6h4Sgz80VxQMLr9YiRmcNwOyCM/f5mjFUr5w2kP 6gDpkIhAerLcFI9mxTsPOu9OjNPpujSD9PjrJShPWLL+Tmtc8+mBGR9faC4ENq855shm i+f+PvzBk0oVHajb50TgvLrxkY1PUKGMG61pKiR2raeoziUntsZsnbFZ2ZapTlscjZWZ IJtgSK1f+5rGtg5E0D/rVtHZC9vOvkkGt4lPmOFmQmWa9EK2jhzDxEsDj/ckUI7P3o43 8kriG5wNhG0mC+p6MtLnf/3O+9KrxzBs6harNLVIBOHfPoXLCrJPM0VUU/RpJA5dnmX1 xbKg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=PcZm607a5PLjRUkF6mKfDqeEFce+Q15c0fPf1nos3g0=; b=wn7Jvqd3JrLtTQr/cOfh56Gbo1iesNHu64d40zyL7CFKpt9cqGDJwVTuSkW+GsFnhv axHBFOr0ZaIdGoDuqxcpgNgb4QwN0+h0c8Rz65sBIBaog2OOqS4+WaaDIxYv7/rqFw9L c9ohHnbTH6OeHym46xTkhYjDEo9od8tKfHohXkRcKNjQd3cHM9mYlrivFGAVlU+Rbv8n jUdRc9l7k5iL9ekW7KGbDxbgGr9NzqJf2gqiHxkBDb1w2OBuVp+UaSjGPrUQv9xboHP+ 6NhLulJhPAFxIXkcpnriFWGweXN1CcGA0ggQMGOj9makAS2G3pQzxfHFPdypdJoz1dwJ hprA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id h2-v6si16420203plk.350.2018.10.16.07.58.53; Tue, 16 Oct 2018 07:58:53 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-scsi-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-scsi-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727086AbeJPWtm (ORCPT + 1 other); Tue, 16 Oct 2018 18:49:42 -0400 Received: from szxga04-in.huawei.com ([45.249.212.190]:14084 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727026AbeJPWtm (ORCPT ); Tue, 16 Oct 2018 18:49:42 -0400 Received: from DGGEMS414-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id C7BD771258B9A; Tue, 16 Oct 2018 22:58:43 +0800 (CST) Received: from localhost.localdomain (10.67.212.75) by DGGEMS414-HUB.china.huawei.com (10.3.19.214) with Microsoft SMTP Server id 14.3.399.0; Tue, 16 Oct 2018 22:58:38 +0800 From: John Garry To: , CC: , , , , John Garry Subject: [PATCH] scsi: hisi_sas: Fix spin lock management in slot_index_alloc_quirk_v2_hw() Date: Tue, 16 Oct 2018 23:00:36 +0800 Message-ID: <1539702036-191138-1-git-send-email-john.garry@huawei.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 X-Originating-IP: [10.67.212.75] X-CFilter-Loop: Reflected Sender: linux-scsi-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-scsi@vger.kernel.org Currently a spin_unlock_irqrestore() call is missing on the error path, so add it. Reported-by: Julia Lawall Signed-off-by: John Garry -- 1.9.1 diff --git a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c index 70d6b28..cc36b64 100644 --- a/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c +++ b/drivers/scsi/hisi_sas/hisi_sas_v2_hw.c @@ -806,8 +806,10 @@ static u32 hisi_sas_phy_read32(struct hisi_hba *hisi_hba, while (1) { start = find_next_zero_bit(bitmap, hisi_hba->slot_index_count, start); - if (start >= end) + if (start >= end) { + spin_unlock_irqrestore(&hisi_hba->lock, flags); return -SAS_QUEUE_FULL; + } /* * SAS IPTT bit0 should be 1, and SATA IPTT bit0 should be 0. */