Re: [PATCH] libnvdimm: fix NULL ptr access in nvdimm_flush when region is disabled

2018-04-10 Thread Dan Williams
On Tue, Apr 10, 2018 at 1:42 PM, Dave Jiang wrote: > When a region is disabled, there is no driver attached. Therefore > dev->driverdata is NULL. An attempt to write to regionN/deep_flush via sysfs > would cause a NULL pointer dereference. Bail when dev->driver is NULL to >

[PATCH] libnvdimm: fix NULL ptr access in nvdimm_flush when region is disabled

2018-04-10 Thread Dave Jiang
When a region is disabled, there is no driver attached. Therefore dev->driverdata is NULL. An attempt to write to regionN/deep_flush via sysfs would cause a NULL pointer dereference. Bail when dev->driver is NULL to protect this scenario. Fix: ab630891ce0eb(libnvdimm, region: sysfs trigger for