Received: by 2002:a25:1104:0:0:0:0:0 with SMTP id 4csp187124ybr; Fri, 22 May 2020 04:18:39 -0700 (PDT) X-Google-Smtp-Source: ABdhPJybSmQsiHxwGHpyJt4ZKK4/EOtply/nojQabP7pBFU8++NRAkesoF05jThhYzApfxcPzVxl X-Received: by 2002:a17:906:cd08:: with SMTP id oz8mr8185290ejb.90.1590146318863; Fri, 22 May 2020 04:18:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590146318; cv=none; d=google.com; s=arc-20160816; b=LKTta5IvL1+CWR49rP2jIxJlq3m2yMP4WikmFthfAmiXKmPmrYosVYIIjrzICbQaIX j+dFTl2wp53Agapk4vEFIz1MA2wNdiBPEIp5AAaO+/RPBEgYqBZ9000S/dZMgq9n0KpC 8AM5E0RXuKFGn/hZ2iODWnXstYKsS4fQFUD59KByR5x0JjmlKJnQfPT3uftE6BFrT9x1 18/JswNl5iXxtjJiRQrEbpipd+9q4NRWU+gQEnGzst/r/G2xdYBSqnSZQ0sGjsPQLVbQ xO8SYIAkW/ektA+xQs/c7UOohBkMnSVUn5IvPEitOeVnA6L7zqCCqkevDSheKRlFO6rO jkiw== 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=g7lofStAEXI4rDBNDclmyeYgluSumM2150lwAjjqFGM=; b=w8c9htzufOGn2RQ5/WAO+PcFwDNcEodGxzwlrVHzaSCj9SEPa7iw98KIlVXCJ6eb4Y KcAd5uWHqPnwfKGBw4JbbBIMvlrLMxa/3sIvcM/1c0OUklJnBGKMnZHdueJRWQUrB25q SvZ+GLMeYs6bybf8ZGGjWnD9BGB/nIjnoUDxMM6luOo9nMm7LxtFO3W63fA6Zc5q4nwU y/qIvJDMaUcnT/VYOfDY9hN6Xb/Fn8KGu6Wys+qH74XIMTN5FNk+nmmMJYkG+9/54EK/ OPh08UwRHto1VLrprS5PMKsZ3imxlsSe6/1IqkelKvvbRrKBDLxaSgNLgyeg1KN64Axt KB4Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@samsung.com header.s=mail20170921 header.b=Un+f+jIU; 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 f19si1831141edy.584.2020.05.22.04.18.14; Fri, 22 May 2020 04:18:38 -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=Un+f+jIU; 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 S1729377AbgEVLQO (ORCPT + 99 others); Fri, 22 May 2020 07:16:14 -0400 Received: from mailout1.w1.samsung.com ([210.118.77.11]:51524 "EHLO mailout1.w1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728800AbgEVLPQ (ORCPT ); Fri, 22 May 2020 07:15:16 -0400 Received: from eucas1p2.samsung.com (unknown [182.198.249.207]) by mailout1.w1.samsung.com (KnoxPortal) with ESMTP id 20200522111512euoutp0107b61a564fff31b9aaaf46f04886d891~RVXbtWG5F1178811788euoutp01e for ; Fri, 22 May 2020 11:15:12 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 mailout1.w1.samsung.com 20200522111512euoutp0107b61a564fff31b9aaaf46f04886d891~RVXbtWG5F1178811788euoutp01e DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=samsung.com; s=mail20170921; t=1590146112; bh=g7lofStAEXI4rDBNDclmyeYgluSumM2150lwAjjqFGM=; h=Subject:To:Cc:From:Date:In-Reply-To:References:From; b=Un+f+jIUmk8Z5599psC7Yb7eNknrtoyvtxiHz3/YuXympaCqIfxzfyDVLpFI/EzRZ QliYDYN+TKL/RN29YC/d9n+Dt0IgE5ZpaNBqDqP3duySJ7VFllF14lzaKwPd2owl87 1u/5iuV8BzPloamQ+sxGSenMdjLt71hchHTIoNu0= Received: from eusmges3new.samsung.com (unknown [203.254.199.245]) by eucas1p2.samsung.com (KnoxPortal) with ESMTP id 20200522111512eucas1p23793e88546caa1e9bbd836fcfa32eedb~RVXbZe0le1441014410eucas1p2J; Fri, 22 May 2020 11:15:12 +0000 (GMT) Received: from eucas1p1.samsung.com ( [182.198.249.206]) by eusmges3new.samsung.com (EUCPMTA) with SMTP id F9.96.60698.044B7CE5; Fri, 22 May 2020 12:15:12 +0100 (BST) Received: from eusmtrp2.samsung.com (unknown [182.198.249.139]) by eucas1p1.samsung.com (KnoxPortal) with ESMTPA id 20200522111512eucas1p17edeeea548dd59170c84c49ec650bd8a~RVXbFw97l0775607756eucas1p1Z; Fri, 22 May 2020 11:15:12 +0000 (GMT) Received: from eusmgms2.samsung.com (unknown [182.198.249.180]) by eusmtrp2.samsung.com (KnoxPortal) with ESMTP id 20200522111512eusmtrp27b43e87159fec26f306e1ffa4579c921~RVXbFEdvK1476214762eusmtrp2k; Fri, 22 May 2020 11:15:12 +0000 (GMT) X-AuditID: cbfec7f5-a0fff7000001ed1a-fa-5ec7b440f52a Received: from eusmtip1.samsung.com ( [203.254.199.221]) by eusmgms2.samsung.com (EUCPMTA) with SMTP id 3D.92.07950.F34B7CE5; Fri, 22 May 2020 12:15:11 +0100 (BST) Received: from [106.210.88.143] (unknown [106.210.88.143]) by eusmtip1.samsung.com (KnoxPortal) with ESMTPA id 20200522111511eusmtip1251a3e0431392af017466d40c4deba33~RVXadmGHQ2677026770eusmtip1W; Fri, 22 May 2020 11:15:11 +0000 (GMT) Subject: Re: [PATCH] i2c: core: fix NULL pointer dereference in suspend/resume callbacks To: linux-pm@vger.kernel.org, linux-i2c@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Wolfram Sang , Bibby Hsieh , Tomasz Figa , Bartosz Golaszewski , srv_heupstream@mediatek.com, Bartlomiej Zolnierkiewicz , linux-samsung-soc@vger.kernel.org From: Marek Szyprowski Message-ID: <34736047-3fc8-385b-cdea-79b061deb7b4@samsung.com> Date: Fri, 22 May 2020 13:15:12 +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: <20200522101327.13456-1-m.szyprowski@samsung.com> Content-Transfer-Encoding: 7bit Content-Language: en-US X-Brightmail-Tracker: H4sIAAAAAAAAA01SbUhTYRjl3b3eXYfT16n5tKJolGGQJhpe+xCVgkERkVEh6Fp5U8tN29Rl IfmdrGw1DHVqZVGm5WdDS0JzTZdKfmaIWiBZoGRim0EfWs6r5b/znHOe9zkHXpoQvXAQ03HK JFallMdLKAHZ2PGjZ3uI0RK1w/jBg6kvqnVgbGVdJFNcV0QyefM2xAw2l1KMNd+MmKLeFh5T +F7EWHMWKKbytYEIEUhnhnP40pL0flKa3dlKSq8bq5C0s2uClFobNhymIgR7otn4uBRW5Rt8 UhCbYSkkE4eoC7daX5HpqMFBixxpwAEw0p9BapGAFuFHCD625iMtohcHGwIDj+OtCPJ6p4iV BZO2nc8JFQjq+mwEN8wgeDM3SNm33XAEmGed7Qvu+DjYhkcpu4fAZTxoG5hBdoHCfqCd1lJ2 LMTB0P9Jx7NjEm+Br7pc0o49cCR033+KOI8rdBZPLPGOi/5fZQVLiQi8EZqmS5exJ4xM3FmK DbiDDzfND3j2QID3QXY/cA3cYMpi5HN4Pfx5vuLPQjDeU83nhmsIBjOLEOfaDWM9P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kjryTe 0NTQ3MLS0NzY3NjMQkmct0PgYIyQQHpiSWp2ampBahFMHxMHp1QD4z7jKDvFz/Fl6xUeO6lM fvF169ll68SezjhTPue/XPD2Pa8XLpg4yeR6VauY35THxUpmMoV1nW+/nFttZ+QQe5xHsO2V b6rQwZX3XmjGsrNnrjkxfYYgZ2GkY7Nos9VzX89zH4Xllou9iCt5+kw2admLpU1OpjybSyQz OnJzTaov9e8q7mT3UmIpzkg01GIuKk4EAIlRpMnjAgAA X-CMS-MailID: 20200522111512eucas1p17edeeea548dd59170c84c49ec650bd8a 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> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi All, 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... > ... Best regards -- Marek Szyprowski, PhD Samsung R&D Institute Poland