From patchwork Mon Jul 24 19:16:47 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Bottomley X-Patchwork-Id: 125181 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:9010:0:b0:3e4:2afc:c1 with SMTP id l16csp2027023vqg; Mon, 24 Jul 2023 13:10:12 -0700 (PDT) X-Google-Smtp-Source: APBJJlFE9RLQMBxQ5Y6HclswcmlvSq/O6nzYVx9X7jC3KSr7mv/0Ekx2s2qgc9zLjsVFSq98SH7l X-Received: by 2002:a17:906:10d6:b0:993:e809:b9ff with SMTP id v22-20020a17090610d600b00993e809b9ffmr10533325ejv.21.1690229412703; Mon, 24 Jul 2023 13:10:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1690229412; cv=none; d=google.com; s=arc-20160816; b=arUkOEZg3GtTmBE+7/aRaafacaPQdVru8eGj0E7fZuRdCngdAjmJW+l5aAsKDL/jA8 iPEceOY4mYMK1W1FIc1LT3pCXugvJOwmkFZ9DQf0IKCFRVh4LPiEYu8D69GSiAHaB9cA eTpcNK+rM+sxol677nRUjZVUcV3lkuBIWbiM2C/aLKADJJ4tit2HaKwF1MV4Jtiy/Pyy 4BbRGXvD1jXoSQj/VYVBCVwwo+UE3V4YvQDXpuUe1e2P2aE/IPMplqbgcWb8bM9S/BxB 5guvDCxUOpDHkCOkQvwFf4s8yEHMPXkz4xQMlmQl59jKR5o7kCF477PiKiCLgD8uck+B JeIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:date:cc:to:from:subject:message-id:dkim-signature :dkim-signature; bh=kBRDa8KqqLUbkW6GnuIslQ2XE4GB/oQG/ZbYAZjBf7I=; fh=QyRsabbae8v3ugALaSIQ85DXz9LbtAN3bWNePyaXtEQ=; b=OHqKpzy8kb6ti2fVr/v6wvxSrWjDFpDiSbabNqpN4W50ugjko5qJMjAa697GA1P6+0 LVdkUezlG2GWMFyRbiUNagGjDkfg6j8uvJkBftCPPfX+gN4hMGzARTaBDQkJh68haBor YgqjRJxkszAiF7vnTjVeDzeHeQ+OZz0krjvysWfehSRQkBw+2T+cwfquAe9LLdl/hFWR OxqoTneaeSauvb0uXPFiUYb10FnajZYn86eu9+h9/z9aGNdvTH8DJLRHdPY3cIW47OM2 PCHv6YRBtOhENd1KX1QQPOUZwKRWz+im1hjAgABuDKqAHU8tkQ1AlgoKlXvHTqczVZIA 55/Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@hansenpartnership.com header.s=20151216 header.b=qKdPPK5S; dkim=pass header.i=@hansenpartnership.com header.s=20151216 header.b=JAwdcEEy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hansenpartnership.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kk27-20020a170907767b00b00988839e5435si6432707ejc.522.2023.07.24.13.09.48; Mon, 24 Jul 2023 13:10:12 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@hansenpartnership.com header.s=20151216 header.b=qKdPPK5S; dkim=pass header.i=@hansenpartnership.com header.s=20151216 header.b=JAwdcEEy; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=hansenpartnership.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230287AbjGXTQ4 (ORCPT + 99 others); Mon, 24 Jul 2023 15:16:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229532AbjGXTQz (ORCPT ); Mon, 24 Jul 2023 15:16:55 -0400 Received: from bedivere.hansenpartnership.com (bedivere.hansenpartnership.com [IPv6:2607:fcd0:100:8a00::2]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EA21E10F7; Mon, 24 Jul 2023 12:16:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hansenpartnership.com; s=20151216; t=1690226211; bh=64pZcItTjZxIjDEl8EzEjacmRIVQb6Kl/2RNtm+3W3o=; h=Message-ID:Subject:From:To:Date:From; b=qKdPPK5SWzbg6WweegJVPDc+Y14TqL+xjdi2NAAyaPnKlINuO2LVdAJtG3j1y+8qb flzU/ZpZSHJeosLdho0eb8gGduWqm1q1MOJR4QdQgWxzbmVyM1BjmGALwIhPXOvu7j 7qr5WH1ClnTJPI3SWLD1sdEDB3nLABEvUrGh4bAk= Received: from localhost (localhost [127.0.0.1]) by bedivere.hansenpartnership.com (Postfix) with ESMTP id D439A128605E; Mon, 24 Jul 2023 15:16:51 -0400 (EDT) Received: from bedivere.hansenpartnership.com ([127.0.0.1]) by localhost (bedivere.hansenpartnership.com [127.0.0.1]) (amavis, port 10024) with ESMTP id C0372O34OdMU; Mon, 24 Jul 2023 15:16:51 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=hansenpartnership.com; s=20151216; t=1690226209; bh=64pZcItTjZxIjDEl8EzEjacmRIVQb6Kl/2RNtm+3W3o=; h=Message-ID:Subject:From:To:Date:From; b=JAwdcEEyF8qhlBRdqM4TQyqzai8kydFBA5oKexXMNAy2J8yww4cZt4nKQyboPAgLt mWM8SXpt/m8sPX+3+XqAUFuxrvhkTZBqHBgmUnRh25yVamP9iR4nxno58zLFWSLVKb 5k77VmlanMLliPfinv2+0r8DC9s8d4yMDtBeAVBs= Received: from [IPv6:2601:5c4:4302:c21::a774] (unknown [IPv6:2601:5c4:4302:c21::a774]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (prime256v1) server-signature RSA-PSS (2048 bits) server-digest SHA256) (Client did not present a certificate) by bedivere.hansenpartnership.com (Postfix) with ESMTPSA id 60AA11281F5F; Mon, 24 Jul 2023 15:16:49 -0400 (EDT) Message-ID: Subject: [GIT PULL] SCSI fixes for 6.5-rc3 From: James Bottomley To: Andrew Morton , Linus Torvalds Cc: linux-scsi , linux-kernel Date: Mon, 24 Jul 2023 15:16:47 -0400 User-Agent: Evolution 3.42.4 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_BLOCKED, SPF_HELO_PASS,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1772333996781104335 X-GMAIL-MSGID: 1772333996781104335 Single fix for a potential regression over a misunderstanding of the blk_get_queue() api. The patch is available here: git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git scsi-fixes The short changelog is: Yu Kuai (1): scsi: sg: Fix checking return value of blk_get_queue() And the diffstat: drivers/scsi/sg.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) With full diff below. James --- cdev = cdev_alloc(); diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index 89fa046c7158..0d8afffd1683 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c @@ -1497,9 +1497,10 @@ sg_add_device(struct device *cl_dev) int error; unsigned long iflags; - error = blk_get_queue(scsidp->request_queue); - if (error) - return error; + if (!blk_get_queue(scsidp->request_queue)) { + pr_warn("%s: get scsi_device queue failed\n", __func__); + return -ENODEV; + } error = -ENOMEM;