Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp2323706pxp; Mon, 21 Mar 2022 16:59:11 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwueo+G3JOMEX4vHvfZshzWLzkDQD1Wc+cXIWhoUJtz+Lg/lgB1mWms0GrkfNmKtXCmfaIa X-Received: by 2002:a17:90a:205:b0:1c6:5b78:5c5 with SMTP id c5-20020a17090a020500b001c65b7805c5mr1740137pjc.54.1647907151603; Mon, 21 Mar 2022 16:59:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647907151; cv=none; d=google.com; s=arc-20160816; b=dOnTg/83dV8lY+DPG4fOO1MnRcwG7RpI3mXrxNZG0sA0901invwggq8aXQnRBjRKYt 4G1ZyoQuR6HIg4wMtVcaQM9UYw5DeQl/wvlX5QwRbs21rMUZ7slt4y9wCMJpfQQ4+Mj1 ZugyT2SgT+DZ5vx5dFooGbh3wsYy9t6KN0Y98bWjcGkXFlmWkDfdlGNQ493sFItZJI6d BZRVBpJYsIgIsr2JvsPw6zTdwkssnDTq97JO8lcdRgVbdBtvTZPDtqeKOXAoKstaUR/n OrYgCSVOfTK3Jaoplv6Bx6zvLF07GvCjJXYo+NstNiamdF0jjvVITte/GNjxSglJuaSm FnXg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:content-transfer-encoding:date :message-id:in-reply-to:cc:to:from:sender:reply-to:subject :mime-version:dkim-signature:dkim-filter; bh=gZ85nLCWNmsAfvqI0fRnfzDwcZzX7wY6ZjjumUxiO1c=; b=tDDvljK1C6MEjBtZpVuxn5Wjh0CQsIMuHc1Lspzz6/UewqNDrmpqjjFXf6SO7FnHJF Eepm3sUwqnK1Yfr0GNAy2dvsd8UHo91spXX3uMi3V7+EJB4TUp2MsttFLwmUS4TgKtSb HFqInY1vgSpAlhLUGNwt7Z8F1G4lOtUxWpNnZfWHKrMyB7vTE0p39n8PLRmVIs9BXcvr IBWzbUo3R68rU0hDZtppilfN3gEwE8J2i12/kNsRk8AOddKkyKmCAuT60ShBrgUVBHTB SOfUW1+h0MP3EfZ7X+n4BvypzqUXNi2LAz6E4wBVGzSzlKLuLNdEZUA5s5AIeIEja3Vv sj0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=hQh2xvqx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id v8-20020a17090a458800b001c72b71a7e4si640637pjg.27.2022.03.21.16.59.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 21 Mar 2022 16:59:11 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=hQh2xvqx; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id CB44C30CDA2; Mon, 21 Mar 2022 16:24:59 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233117AbiCUX0U (ORCPT + 99 others); Mon, 21 Mar 2022 19:26:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36692 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232602AbiCUX0M (ORCPT ); Mon, 21 Mar 2022 19:26:12 -0400 Received: from mailout1.samsung.com (mailout1.samsung.com [203.254.224.24]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6F9E230CDA2 for ; Mon, 21 Mar 2022 16:20:26 -0700 (PDT) Received: from epcas3p4.samsung.com (unknown [182.195.41.22]) by mailout1.samsung.com (KnoxPortal) with ESMTP id 20220321225302epoutp01d84c85b3411e706087958a05724052f1~ehzaWg9Jd3003230032epoutp01y for ; Mon, 21 Mar 2022 22:53:02 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.samsung.com 20220321225302epoutp01d84c85b3411e706087958a05724052f1~ehzaWg9Jd3003230032epoutp01y DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1647903182; bh=gZ85nLCWNmsAfvqI0fRnfzDwcZzX7wY6ZjjumUxiO1c=; h=Subject:Reply-To:From:To:CC:In-Reply-To:Date:References:From; b=hQh2xvqxioLvEpER8Wz4p0rsb2itJcbWLL2m0SUuFT+8BERFbgpitCqLq49NjOgPy 1jU8+tX0KTao2K3cydkoMye7BwDxXIGVIEJRjG3jOto7JVx6YA3HTUoeV71DM3caeA 5faaNKFJYgtOchA1/KgaTqXmQcRj30jBhQ/1pnnA= Received: from epsnrtp2.localdomain (unknown [182.195.42.163]) by epcas3p3.samsung.com (KnoxPortal) with ESMTP id 20220321225301epcas3p3f8bd9168c5b66209b475531c5b365d88~ehzZw3aKD0753007530epcas3p3P; Mon, 21 Mar 2022 22:53:01 +0000 (GMT) Received: from epcpadp4 (unknown [182.195.40.18]) by epsnrtp2.localdomain (Postfix) with ESMTP id 4KMqdn3gH8z4x9Pv; Mon, 21 Mar 2022 22:53:01 +0000 (GMT) Mime-Version: 1.0 Subject: RE: [PATCH v2] ufs: fix an NULL check on list iterator Reply-To: daejun7.park@samsung.com Sender: Daejun Park From: Daejun Park To: Xiaomeng Tong , ALIM AKHTAR CC: "avri.altman@wdc.com" , "jejb@linux.ibm.com" , "martin.petersen@oracle.com" , Daejun Park , "beanhuo@micron.com" , "bvanassche@acm.org" , Keoseong Park , "gregkh@linuxfoundation.org" , "stanley.chu@mediatek.com" , "linux-scsi@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "jakobkoschel@gmail.com" X-Priority: 3 X-Content-Kind-Code: NORMAL In-Reply-To: <20220320150733.21824-1-xiam0nd.tong@gmail.com> X-CPGS-Detection: blocking_info_exchange X-Drm-Type: N,general X-Msg-Generator: Mail X-Msg-Type: PERSONAL X-Reply-Demand: N Message-ID: <1891546521.01647903181504.JavaMail.epsvc@epcpadp4> Date: Mon, 21 Mar 2022 22:17:08 +0900 X-CMS-MailID: 20220321131708epcms2p666061b9d088cbc5319af243a9aed44a0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" X-Sendblock-Type: AUTO_CONFIDENTIAL X-CPGSPASS: Y X-CPGSPASS: Y X-Hop-Count: 3 X-CMS-RootMailID: 20220320150754epcas2p3ffdbcd31ff5f4432e8d0a1106c91d729 References: <20220320150733.21824-1-xiam0nd.tong@gmail.com> X-Spam-Status: No, score=-1.6 required=5.0 tests=BAYES_00,DATE_IN_PAST_06_12, DKIMWL_WL_HIGH,DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Hi Xiaomeng Tong, >The list iterator is always non-NULL so the check 'if (!rgn)' >is always false and the dev_err() is never called. Move the >check outside the loop and determine if 'victim_rgn' is NULL, >to fix this bug. > >Fixes: 4b5f49079c52a ("scsi: ufs: ufshpb: L2P map management for HPB read") >Signed-off-by: Xiaomeng Tong >--- Good catch. Free to add my reviewed-by tag. Reviewed-by: Daejun Park Thanks, Daejun