From patchwork Mon Nov 5 17:23:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Bart Van Assche X-Patchwork-Id: 10668793 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B7C2914BD for ; Mon, 5 Nov 2018 17:23:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9A15E298EF for ; Mon, 5 Nov 2018 17:23:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A0032994F; Mon, 5 Nov 2018 17:23:59 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.0 required=2.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI,SUBJ_OBFU_PUNCT_FEW, SUBJ_OBFU_PUNCT_MANY autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 52311298EF for ; Mon, 5 Nov 2018 17:23:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730031AbeKFCoi (ORCPT ); Mon, 5 Nov 2018 21:44:38 -0500 Received: from com-out001.mailprotect.be ([83.217.72.83]:36231 "EHLO com-out001.mailprotect.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729748AbeKFCoh (ORCPT ); Mon, 5 Nov 2018 21:44:37 -0500 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=mailprotect.be; s=mail; h=Content-Transfer-Encoding:MIME-Version:Message-Id :Date:Subject:Cc:To:From:reply-to:sender:bcc:in-reply-to:references: content-type; bh=WRiNUqC5Fkj5sGgsfD6Mk6XYuLwzoFTUuH5oaZVHSp4=; b=lHpcopNj58HW x3GFZn6aezujqy/kAGu5/Afwzq63vG5lzzX9TU8k/ASIEpyMf8vCzSIX5rM389zTRFD7vf1wCbDEw LY15kGKHa3a01vVXNaM4ixjF2fM3mDtO18++k+IXyB0cNtR3wiXyL984sVumOE0U0nMpqKTieHdL6 Dv/PLtX0iFZOMgGAjoggKdmNyt3Uz3nJIUI1PXoIEO6ZkZ56bunI/dd9WGy+oVjQw0LvOwHHv9TgK p7BvZwz0XrhnGF2KuqIgLNsEz2NLs1Cr7EgcDkmZfBxdWRKkSlB8OdZQ4aJ8rZkauC/blULXxXmJW 5NZI3hqyaDrhy5aYPMfX7w==; Received: from smtp-auth.mailprotect.be ([178.208.39.155]) by com-mpt-out001.mailprotect.be with esmtp (Exim 4.89) (envelope-from ) id 1gJibE-0009K8-CW; Mon, 05 Nov 2018 18:23:46 +0100 Received: from desktop-bart.svl.corp.google.com (unknown [104.133.8.89]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by smtp-auth.mailprotect.be (Postfix) with ESMTPSA id 8BBCBC073F; Mon, 5 Nov 2018 18:23:32 +0100 (CET) From: Bart Van Assche To: "Martin K . Petersen" Cc: Christoph Hellwig , target-devel@vger.kernel.org, Bart Van Assche , Nicholas Bellinger , Mike Christie , Hannes Reinecke Subject: [PATCH] target/core: Make it safe to pass NULL as third argument to compare_and_write_callback() Date: Mon, 5 Nov 2018 09:23:17 -0800 Message-Id: <20181105172317.248955-1-bvanassche@acm.org> X-Mailer: git-send-email 2.19.1.930.g4563a0d9d0-goog MIME-Version: 1.0 X-Originating-IP: 178.208.39.155 X-SpamExperts-Domain: mailprotect.be X-SpamExperts-Username: 178.208.39.128/27 Authentication-Results: mailprotect.be; auth=pass smtp.auth=178.208.39.128/27@mailprotect.be X-SpamExperts-Outgoing-Class: ham X-SpamExperts-Out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WgcHzHNTu4W3OyTlA5uhTP73RN8y cSzpfj5sSQhb3cc4IkKXIhy+I6DM7/owTL8J95f1/+MXnOL6CZv+n8/wRksD+x9JjG1O+eyolGM4 l8rlxuGfhU+34hrNm42X2UZAYRVVEuFqpn0Wcxxec4eIhtK5Pi2eqhlDMrilbtDDvtO4rayUOwaR X-Report-Abuse-To: spam@com-mpt-mgt001.mailprotect.be Sender: target-devel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: target-devel@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Fixes: aa73237dcb2d ("scsi: target/core: Always call transport_complete_callback() upon failure") Cc: Nicholas Bellinger Cc: Mike Christie Cc: Christoph Hellwig Cc: Hannes Reinecke Signed-off-by: Bart Van Assche --- Hi Martin, This patch fixes a bug that was introduced during the merge window. Please consider this patch for a v4.20-rc kernel. drivers/target/target_core_sbc.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/target/target_core_sbc.c b/drivers/target/target_core_sbc.c index 1ac1f7d2e6c9..7c8433e32906 100644 --- a/drivers/target/target_core_sbc.c +++ b/drivers/target/target_core_sbc.c @@ -480,7 +480,8 @@ static sense_reason_t compare_and_write_callback(struct se_cmd *cmd, bool succes if (cmd->scsi_status) { pr_debug("compare_and_write_callback: non zero scsi_status:" " 0x%02x\n", cmd->scsi_status); - *post_ret = 1; + if (post_ret) + *post_ret = 1; if (cmd->scsi_status == SAM_STAT_CHECK_CONDITION) ret = TCM_LOGICAL_UNIT_COMMUNICATION_FAILURE; goto out;