Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp1937020ima; Thu, 25 Oct 2018 07:16:45 -0700 (PDT) X-Google-Smtp-Source: AJdET5cARBg54gK8fGAVqggJ2YbAIie0sXjwRDu69X63YQze69CATHtdZOgZh3vQExeDCw+zHY0Y X-Received: by 2002:a63:5b1f:: with SMTP id p31mr1676294pgb.56.1540477005471; Thu, 25 Oct 2018 07:16:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540477005; cv=none; d=google.com; s=arc-20160816; b=sOMn9O27QwH6yiouN/3r0ZrLttD3iksu3IjuDv8vOwMkA1O9HlMFquLUpU2mzW6lWT LdDRUvehro0hKhcHEeV4rlpt6ic8lDDyP1u67KnpqKM403LlGXSZoTgcOjg98k1OThqo wZl2GJh7pPryZ0cF7Zfe5blKeUrHubyZZ3JSnIyi8xKhQvfie2S7N8ci5jEBxlNoNxb7 zFM+Q5+QfwhxFqrkRzQAY+RFRSYJkNEPgagFxJ0hC10VE9Wr7r5qejrCanKoihQDZrZ/ g25Aon0V+J1HzDoMt/3OfpwbTqSa6F8U/ib05W02CA5IfDKRDtPsSRX99UhRrNUxgYH5 Q/aQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature; bh=qIvRaJT9HZF5TMhaGkVELyFK4ZqUNijNjjEM2B6oO0U=; b=WqPGK7+KAooqIiSHmFVKGOwQpNhsZLAOvIZfgk2lX64EfH2CRP2T1/87Vd5vP78zSW Tlij3pveoFE+1imvxOlZ5fbJePqiFgarvbCN11veCUI6Qs0O8aeH1tFRtRcxpV/MVsbu z783jhGBuDt6xJsR6Y4jBHUYmZQ9LtsosqLF9fvpS/9pgdezOww6PHgLYuxgCoXE/znS 7ETWRJl82Iwx7WZ1TZzweOAI07GB6yWBIW+9lYKaZqqTy2n8rht99fZGP58NvGVB11DX 7h1th6RSZn8ksOKjTwlsTvnyd3tRgwccOpfonqoC3yDm+p0KfaHcrv4F7XISpToylvFi IkIw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cViWzvkM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a7-v6si7379516pga.322.2018.10.25.07.16.14; Thu, 25 Oct 2018 07:16:45 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=cViWzvkM; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728046AbeJYWoO (ORCPT + 99 others); Thu, 25 Oct 2018 18:44:14 -0400 Received: from mail.kernel.org ([198.145.29.99]:52880 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727739AbeJYWoO (ORCPT ); Thu, 25 Oct 2018 18:44:14 -0400 Received: from sasha-vm.mshome.net (unknown [167.98.65.38]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 079C320840; Thu, 25 Oct 2018 14:11:17 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1540476679; bh=bnh2x8Dql10PSNZKG1iD8t66UzIi4TbzZSRE21F5F2w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=cViWzvkMi7JGwi+p+x9rWNSnJV8dFmBSGZpFhXbqh9XH1t9q9UBo9revn1VyKs90i WUGgcmvHoxaA1sq7B8Ec1dMlOrNIBU+eG4Gv1wFN39q/x8Irs5SGv4TkvFCA9iZWqt ov4iYExycna9VdY56DjyVQxq2o0fJN84nR8vBRlc= From: Sasha Levin To: stable@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Ben Hutchings , "Martin K . Petersen" , Sasha Levin Subject: [PATCH AUTOSEL 4.14 17/46] scsi: qla2xxx: Avoid double completion of abort command Date: Thu, 25 Oct 2018 10:10:24 -0400 Message-Id: <20181025141053.213330-17-sashal@kernel.org> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20181025141053.213330-1-sashal@kernel.org> References: <20181025141053.213330-1-sashal@kernel.org> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Ben Hutchings [ Upstream commit 3a9910d7b686546dcc9986e790af17e148f1c888 ] qla2x00_tmf_sp_done() now deletes the timer that will run qla2x00_tmf_iocb_timeout(), but doesn't check whether the timer already expired. Check the return value from del_timer() to avoid calling complete() a second time. Fixes: 4440e46d5db7 ("[SCSI] qla2xxx: Add IOCB Abort command asynchronous ...") Fixes: 1514839b3664 ("scsi: qla2xxx: Fix NULL pointer crash due to active ...") Signed-off-by: Ben Hutchings Acked-by: Himanshu Madhani Signed-off-by: Martin K. Petersen Signed-off-by: Sasha Levin --- drivers/scsi/qla2xxx/qla_init.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/qla2xxx/qla_init.c b/drivers/scsi/qla2xxx/qla_init.c index 1d42d38f5a45..0e19f6bc24ff 100644 --- a/drivers/scsi/qla2xxx/qla_init.c +++ b/drivers/scsi/qla2xxx/qla_init.c @@ -1365,8 +1365,8 @@ qla24xx_abort_sp_done(void *ptr, int res) srb_t *sp = ptr; struct srb_iocb *abt = &sp->u.iocb_cmd; - del_timer(&sp->u.iocb_cmd.timer); - complete(&abt->u.abt.comp); + if (del_timer(&sp->u.iocb_cmd.timer)) + complete(&abt->u.abt.comp); } int -- 2.17.1