[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <uksugjuktrlak5uvbndrtho7gwhvnxe2xftwxlqg4o4bemuar2@3gyuczh6n7dq>
Date: Wed, 30 Aug 2023 08:48:37 -0700
From: Davidlohr Bueso <dave@...olabs.net>
To: Ira Weiny <ira.weiny@...el.com>
Cc: Jonathan Cameron <jonathan.cameron@...wei.com>,
Dave Jiang <dave.jiang@...el.com>,
Alison Schofield <alison.schofield@...el.com>,
Vishal Verma <vishal.l.verma@...el.com>,
Dan Williams <dan.j.williams@...el.com>,
linux-cxl@...r.kernel.org, linux-kernel@...r.kernel.org,
Ben Widawsky <bwidawsk@...nel.org>
Subject: Re: [PATCH] cxl/region: Clarify pointers in unregister_region()
On Tue, 29 Aug 2023, Ira Weiny wrote:
>devm_add_action_or_reset() passes a void * data parameter to the
>callback. In the case of CXL regions, unregister_region() is passed a
>struct cxl_region *.
>
>unregister_region() incorrectly interprets this as a struct device
>pointer. Fortunately the device structure was the first member of
>cxl_region. Therefore the code still works. However, should struct
>cxl_region change the bug could be subtle.
>
>Use the proper types in unregister_region() and extract the device
>pointer correctly.
>
>Fixes: 779dd20cfb56 ("cxl/region: Add region creation support")
>Cc: Ben Widawsky <bwidawsk@...nel.org>
>Signed-off-by: Ira Weiny <ira.weiny@...el.com>
Reviewed-by: Davidlohr Bueso <dave@...olabs.net>
Powered by blists - more mailing lists