File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -1107,6 +1107,13 @@ static void ses_intf_remove_enclosure(struct scsi_device *sdev)
11071107 edev -> poll_task = NULL ;
11081108 }
11091109
1110+ /* enclosure_unregister() sets ->cb to NULL callbacks, preventing any
1111+ * further SES driver calls. It removes enclosure sysfs entries,
1112+ * eliminating the race window. edev remains valid as we hold a ref;
1113+ * it will be freed in enclosure_release() via our put_device() below.
1114+ */
1115+ enclosure_unregister (edev );
1116+
11101117 ses_dev = edev -> scratch ;
11111118 edev -> scratch = NULL ;
11121119
@@ -1118,8 +1125,8 @@ static void ses_intf_remove_enclosure(struct scsi_device *sdev)
11181125 if (edev -> components )
11191126 kfree (edev -> component [0 ].scratch );
11201127
1128+ /* Drop last reference from enclosure_find() */
11211129 put_device (& edev -> edev );
1122- enclosure_unregister (edev );
11231130}
11241131
11251132static void ses_intf_remove (struct device * cdev )
You can’t perform that action at this time.
0 commit comments