Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp4198329pxk; Tue, 29 Sep 2020 17:54:29 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxbvht+pDE5MmB31ED8XKI3txCXLVsEtBnYFOKALC68z034P3J60p+Z6XhYv5USx1BpNAdx X-Received: by 2002:a50:a693:: with SMTP id e19mr111470edc.205.1601427269358; Tue, 29 Sep 2020 17:54:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601427269; cv=none; d=google.com; s=arc-20160816; b=h0rF+lp7RZ4bF2CGBw+C2do7WrvcesZJsgGwp1Ej2drfgZFXBr/XH3XARdane84xrS DxHphsXX/24EKfauGz54lq6xXTK0I0THZW3JyHdrnSK1BRKHgoyRm7G0Gj7HV7eai8Ts 66ubS2M5M7FdAXm+4OZiCDRxQGmAu1AzIL3DPFb1JA8tZ+p6+H6mzvZiB6Hu5KHQtFWR F9MsDcTCeI6rNFnb0PptJsA+LFFkdNiPcsbfynQ6/MLAYLO/KK6tUj8g7MjKDjbMJUNj btRED+lZLwrCGkxhiRi8ENKztjO5twyjIQ66w7chAmafYreseLf/si7MIeebJhJWNYZZ vfYw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to :mime-version:user-agent:date:message-id:from:cc:references:to :subject; bh=Ev1YBMZ9jypnugTc7zw9JrbZUvxVBfgh5QiEWpqbAlc=; b=Pn05L2mje38gQhTDihjqdqRslPDPun/sGl8p3Kq7TDawW2gB+TMtw7O5C/dUT5K7Fe tJFaDzYBR5YdCQ0iLBedYszTZyRntWl+6JTchrhashqZeZ1SIPqWE+x/h5PIbZbvODKv RDTAyGyMxTVe0h4oo24nUSqVGSRIAp+KjXc0xJJ83AK93XA77Gt1cIeEIFw/2p4uDmPc tk3e5w1CtU9vUbg65whl192XQrnvr7EyZjQ4EjdFQsm+fOE7WEKxTuOqkUsJsKFhaDr6 Tb3dCkFOY8w26sGSQYOIaPXGbQi+pXcz1QRGflXHSz0zREt65s7extI0ZsNwY3Fr3PCq AL+Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id p17si117702ejo.270.2020.09.29.17.53.53; Tue, 29 Sep 2020 17:54:29 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729322AbgI3AuH (ORCPT + 99 others); Tue, 29 Sep 2020 20:50:07 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:40476 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726806AbgI3AuG (ORCPT ); Tue, 29 Sep 2020 20:50:06 -0400 Received: from DGGEMS401-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 901CC35C07DAD9C4034E; Wed, 30 Sep 2020 08:50:04 +0800 (CST) Received: from [10.174.179.1] (10.174.179.1) by smtp.huawei.com (10.3.19.201) with Microsoft SMTP Server (TLS) id 14.3.487.0; Wed, 30 Sep 2020 08:49:59 +0800 Subject: Re: [PATCH] scsi: esas2r: prevent a potential NULL dereference in esas2r_probe() To: "Martin K. Petersen" References: <20200909084653.79341-1-jingxiangfeng@huawei.com> CC: , , , From: Jing Xiangfeng Message-ID: <5F620166.7070305@huawei.com> Date: Wed, 16 Sep 2020 20:13:26 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:38.0) Gecko/20100101 Thunderbird/38.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="windows-1252"; format=flowed Content-Transfer-Encoding: 7bit X-Originating-IP: [10.174.179.1] X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020/9/16 5:44, Martin K. Petersen wrote: > > Jing, > >> esas2r_probe() calls scsi_host_put() in an error path. However, >> esas2r_log_dev() may hit a potential NULL dereference. So use NUll instead. > > Wouldn't it be better to move the scsi_host_put() call after the error > message? There is already a message before the scsi_host_put() call. It is used to record calling function. >