Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp1037588ybs; Mon, 25 May 2020 05:50:10 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxvkLQKnCh2h3cVvvTTMm7Uns7d06U/bLGi/0JG8hscax9NIRhIhOKspakLyXy8WoF1YWWE X-Received: by 2002:aa7:cb4f:: with SMTP id w15mr15189452edt.239.1590411010712; Mon, 25 May 2020 05:50:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590411010; cv=none; d=google.com; s=arc-20160816; b=CSX/idBaNwpPi4oWR5yisFW1BX3NmWi+gFcAk4+QmMbp5wbHo3xPAw56+XfIbINzsW rMtYYBraxmOAB04fx9UFaFFY9SMhfq4i2PzXU19muScyNOSTw7LnFk7lX5WncE++83js 3Kt04KNeaIN9njNVc8qA6PtB272Xdo/3zjPNvdohNRZnW/RZ3NFmCUA/haY5zyEtuFeg nkPMPGsLMNgQjM9L+i7ZR9YKOYQc2I6tYu2JAJyFAYyAkYhTuztTzxKzNGmGdVnxDAHI KHMZYAPmsqHkO3sJimG8BY8EnmDSQxXAp+Ckh+4p4i+f7kbKoeN/R17qoWHuBNQy80B1 ZMlg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:cms-type:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:cc:to:subject:dkim-signature:dkim-filter; bh=WSbY84KbUGFbLyo6SUqTrYaZH9Ab/qZiVUsKoLI42iw=; b=cPAh4DKcRjRlQxoV+khut6GVyuxXQHLNXrG9ulG/s6msnxiSzRNPt/R+5U7v0Y5Bxo iR5fugHQUr1Ofz/5G0z16xY+Rjr2IepbFbEy6px7sSiYyvU16yvsR59SdkTZoh/4BBhG EXG7bEu2gWMs4kBIehDfxge3zCa92H7iMsp5GxQwxorXQmd0Ddj1w2/8Bp864E+mvuTf /q5u2PBW74C37l22SZ93BN7Xlk/vrU7S37Dd6E3hDAWsxACVQYBnG4magWfqiePhPg0E YxZ6kl3XezHOjlMmwWUKPOW3snyPHv83wSb7c+CiQ0XwiNz6k9QkmLdKQx9wHfWB4jVC ZmpA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=nU79SSkE; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id se12si10021548ejb.86.2020.05.25.05.49.46; Mon, 25 May 2020 05:50:10 -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; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=nU79SSkE; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=samsung.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2390618AbgEYMn7 (ORCPT + 99 others); Mon, 25 May 2020 08:43:59 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:51476 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390595AbgEYMn6 (ORCPT ); Mon, 25 May 2020 08:43:58 -0400 Received: from eucas1p1.samsung.com (unknown [182.198.249.206]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200525124356euoutp013dbce197ddc411583f2ad76c68030187~SRgw-RSOt0293702937euoutp013 for ; Mon, 25 May 2020 12:43:56 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200525124356euoutp013dbce197ddc411583f2ad76c68030187~SRgw-RSOt0293702937euoutp013 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1590410636; bh=WSbY84KbUGFbLyo6SUqTrYaZH9Ab/qZiVUsKoLI42iw=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=nU79SSkESRoSeFaLsdTqupsE9qSA1wJhg2vElk9ARFXXq2/JGPWtc9+pgKQYb6hsA 50WJlf35pMJNO0+Sz6Igorq7izAUsb16oEz/rAcI6gmPfQw/zGxKowNn8b7UAZRQfR Q3ozL8bnCUhOBR6Bm3z4mYBIC3bGz0iCtfbsb2gk= Received: from eusmges1new.samsung.com (unknown [203.254.199.242]) by eucas1p1.samsung.com (KnoxPortal) with ESMTP id 20200525124356eucas1p1d14dd0b7bf2919bdbe1f1bef094c0634~SRgwvW9Yk1354113541eucas1p10; Mon, 25 May 2020 12:43:56 +0000 (GMT) Received: from eucas1p2.samsung.com ( [182.198.249.207]) by eusmges1new.samsung.com (EUCPMTA) with SMTP id B4.CC.61286.C8DBBCE5; Mon, 25 May 2020 13:43:56 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p2.samsung.com (KnoxPortal) with ESMTPA id 20200525124355eucas1p28f232f83f79fee234635a64270e4dd32~SRgwFl-M92127721277eucas1p2J; Mon, 25 May 2020 12:43:55 +0000 (GMT) Received: from eusmgms1.samsung.com (unknown [182.198.249.179]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200525124355eusmtrp27a65ce5361bfea56fc7aeda010be4b81~SRgwE6aPp0100701007eusmtrp2j; Mon, 25 May 2020 12:43:55 +0000 (GMT) X-AuditID: cbfec7f2-f0bff7000001ef66-41-5ecbbd8cbbf3 Received: from eusmtip2.samsung.com ( [203.254.199.222]) by eusmgms1.samsung.com (EUCPMTA) with SMTP id 60.43.08375.B8DBBCE5; Mon, 25 May 2020 13:43:55 +0100 (BST) Received: from [106.210.88.143] (unknown [106.210.88.143]) by eusmtip2.samsung.com (KnoxPortal) with ESMTPA id 20200525124355eusmtip2f220baba69d595fe546ae2255a0cf363~SRgvfJiAM0854808548eusmtip2D; Mon, 25 May 2020 12:43:55 +0000 (GMT) Subject: Re: [PATCH] i2c: core: fix NULL pointer dereference in suspend/resume callbacks To: Tomasz Figa , Bibby Hsieh Cc: Linux PM , linux-i2c , Linux Kernel Mailing List , Wolfram Sang , Bartosz Golaszewski , srv_heupstream , Bartlomiej Zolnierkiewicz , linux-samsung-soc From: Marek Szyprowski Message-ID: <77f41c67-cd6f-59c5-15b4-c7d8756ca28a@samsung.com> Date: Mon, 25 May 2020 14:43:55 +0200 User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: Content-Transfer-Encoding: 7bit Content-Language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrHKsWRmVeSWpSXmKPExsWy7djP87o9e0/HGew4Km2xccZ6Vosvc0+x WMzcMIPFouPvF0aLy7vmsFl87j3CaDHj/D4mi+l3hSw+t/5js1h5YhazA5fH+xut7B6zGy6y eLSc3M/i0bdlFaPHyVNPWDw+b5ILYIvisklJzcksSy3St0vgyphzaCFLwQmuil2HZrA1MJ7n 6GLk5JAQMJHofzWfrYuRi0NIYAWjxLx9JxkhnC+MEhtXtLBCOJ8ZJQ43TAZyOMBaZnXlQMSX M0r8PHufHcJ5zyjx/Pk3NpAiYYEoiSMf+UBWiAj4SPyf2AA2lVmgiVni2s0XTCAJNgFDia63 XWwgNq+AncTH60uZQWwWAVWJBbMXgdmiArESpxdvZoSoEZQ4OfMJC4jNKRAo8ezdMbAaZgF5 ie1v50DZ4hK3nsxnAlkmIXCOXeLV/gcsEI+6SJx+/IMJwhaWeHV8CzuELSPxfydMQzOjxMNz a9khnB5GictNMxghqqwl7pz7BfYas4CmxPpd+hBhR4lNf68wQ4KFT+LGW0GII/gkJm2bDhXm lehoE4KoVpOYdXwd3NqDFy4xT2BUmoXktVlI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1ILUIpg+Jg5OqQbGmozVvptYUpQS 8vY9Mjp+qW+/5ImiRZ4izufSygILmFQ2ZC5jseXTkZ1+Xu7V6d3beD7XTjUTWFMhd6nOVUHn zu/UngqZxz23nwi93ms3wdVALHvfquu2P3JFYx1fy015KTX5tajSpPzWbyLfS25XxlwVP7Y+ v0v6zZaIjd+3fz4+zdPKX5FDiaU4I9FQi7moOBEAlwxD7eQCAAA= X-CMS-MailID: 20200525124355eucas1p28f232f83f79fee234635a64270e4dd32 X-Msg-Generator: CA Content-Type: text/plain; charset="utf-8" X-RootMTR: 20200522101524eucas1p1aeef4a054a80b5d822ed3dc4b16139d7 X-EPHeader: CA CMS-TYPE: 201P X-CMS-RootMailID: 20200522101524eucas1p1aeef4a054a80b5d822ed3dc4b16139d7 References: <20200522101327.13456-1-m.szyprowski@samsung.com> <34736047-3fc8-385b-cdea-79b061deb7b4@samsung.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Tomasz On 25.05.2020 14:28, Tomasz Figa wrote: > On Fri, May 22, 2020 at 1:15 PM Marek Szyprowski > wrote: >> On 22.05.2020 12:13, Marek Szyprowski wrote: >>> Commit 6fe12cdbcfe3 ("i2c: core: support bus regulator controlling in >>> adapter") added generic suspend and resume functions for i2c devices. >>> Those functions unconditionally access an i2c_client structure assigned >>> to the given i2c device. However, there exist i2c devices in the system >>> without a valid i2c_client. Add the needed check before accessing the >>> i2c_client. >> Just one more comment. The devices without i2c_client structure are the >> i2c 'devices' associated with the respective i2c bus. They are visible >> in /sys: >> >> ls -l /sys/bus/i2c/devices/i2c-* >> >> I wonder if this patch has been ever tested with system suspend/resume, >> as those devices are always available in the system... > Sorry for the trouble and thanks a lot for the fix. We'll make sure to > do more thorough testing, including suspend/resume before relanding > this change. > > Since the patch was reverted, can we squash your fix with the next > revision together with your Co-developed-by and Signed-off-by tags? Sure, no problem. The fix is trivial. Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland