linux/drivers/nvdimm
Yi Yang 12433c87d2 nvdimm: rectify the illogical code within nd_dax_probe()
[ Upstream commit b613521014 ]

When nd_dax is NULL, nd_pfn is consequently NULL as well. Nevertheless,
it is inadvisable to perform pointer arithmetic or address-taking on a
NULL pointer.
Introduce the nd_dax_devinit() function to enhance the code's logic and
improve its readability.

Signed-off-by: Yi Yang <yiyang13@huawei.com>
Reviewed-by: Dave Jiang <dave.jiang@intel.com>
Link: https://patch.msgid.link/20241108085526.527957-1-yiyang13@huawei.com
Signed-off-by: Ira Weiny <ira.weiny@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
History 2024-12-14 19:54:47 +01:00
..
badrange.c mm/memremap_pages: convert to 'struct range' 2020-10-13 18:38:28 -07:00
btt.c nvdimm-btt: Use the enum req_op type 2022-07-14 12:14:31 -06:00
btt.h nvdimm-btt: convert to blk_alloc_disk/blk_cleanup_disk 2021-06-01 07:42:23 -06:00
btt_devs.c nvdimm: Drop nd_device_lock() 2022-04-28 14:01:55 -07:00
bus.c cxl/pmem: Fix nvdimm registration races 2023-03-10 09:34:20 +01:00
claim.c libnvdimm: Cleanup include of badblocks.h 2020-12-15 21:47:45 -08:00
core.c nvdimm: Fix firmware activation deadlock scenarios 2022-04-28 14:01:56 -07:00
dax_devs.c nvdimm: rectify the illogical code within nd_dax_probe() 2024-12-14 19:54:47 +01:00
dimm.c libnvdimm: Make remove callback return void 2021-02-16 19:35:29 -08:00
dimm_devs.c cxl/pmem: Fix nvdimm registration races 2023-03-10 09:34:20 +01:00
e820.c libnvdimm/e820: Retrieve and populate correct 'target_node' info 2020-02-18 10:28:05 -08:00
Kconfig nvdimm: Support sizeof(struct page) > MAX_STRUCT_PAGE_SIZE 2023-02-14 19:11:53 +01:00
label.c nvdimm/region: Delete nd_blk_region infrastructure 2022-03-11 15:53:13 -08:00
label.h nvdimm/region: Delete nd_blk_region infrastructure 2022-03-11 15:53:13 -08:00
Makefile drivers/nvdimm: Fix build failure when CONFIG_PERF_EVENTS is not set 2022-03-23 12:17:36 -07:00
namespace_devs.c nvdimm: Fix devs leaks in scan_labels() 2024-10-17 15:21:04 +02:00
nd-core.h cxl/pmem: Fix nvdimm registration races 2023-03-10 09:34:20 +01:00
nd.h nvdimm: rectify the illogical code within nd_dax_probe() 2024-12-14 19:54:47 +01:00
nd_perf.c nvdimm: Fix dereference after free in register_nvdimm_pmu() 2023-09-13 09:42:47 +02:00
nd_virtio.c virtio_pmem: Check device status before requesting flush 2024-10-17 15:22:16 +02:00
of_pmem.c libnvdimm/of_pmem: Use devm_kstrdup instead of kstrdup and check its return value 2023-11-20 11:52:05 +01:00
pfn.h libnvdimm/namespace: Enforce memremap_compat_align() 2020-03-17 12:23:21 -07:00
pfn_devs.c nvdimm: Support sizeof(struct page) > MAX_STRUCT_PAGE_SIZE 2023-02-14 19:11:53 +01:00
pmem.c Merge branch 'for-6.0/dax' into libnvdimm-fixes 2022-09-24 18:14:12 -07:00
pmem.h dax: introduce DAX_RECOVERY_WRITE dax access mode 2022-05-16 13:35:56 -07:00
region.c nvdimm: Drop nd_device_lock() 2022-04-28 14:01:55 -07:00
region_devs.c nd_btt: Make BTT lanes preemptible 2023-11-20 11:52:05 +01:00
security.c nvdimm: make __nvdimm_security_overwrite_query static 2022-09-20 10:23:52 -07:00
virtio_pmem.c virtio_pmem: set device ready in probe() 2022-08-11 04:06:37 -04:00
virtio_pmem.h virtio-pmem: Add virtio pmem driver 2019-07-05 15:19:10 -07:00