File tree Expand file tree Collapse file tree 1 file changed +6
-2
lines changed
drivers/infiniband/hw/hfi1 Expand file tree Collapse file tree 1 file changed +6
-2
lines changed Original file line number Diff line number Diff line change @@ -1227,7 +1227,8 @@ DEBUGFS_FILE_OPS(fault_stats);
12271227
12281228static void fault_exit_opcode_debugfs (struct hfi1_ibdev * ibd )
12291229{
1230- debugfs_remove_recursive (ibd -> fault_opcode -> dir );
1230+ if (ibd -> fault_opcode )
1231+ debugfs_remove_recursive (ibd -> fault_opcode -> dir );
12311232 kfree (ibd -> fault_opcode );
12321233 ibd -> fault_opcode = NULL ;
12331234}
@@ -1255,6 +1256,7 @@ static int fault_init_opcode_debugfs(struct hfi1_ibdev *ibd)
12551256 & ibd -> fault_opcode -> attr );
12561257 if (IS_ERR (ibd -> fault_opcode -> dir )) {
12571258 kfree (ibd -> fault_opcode );
1259+ ibd -> fault_opcode = NULL ;
12581260 return - ENOENT ;
12591261 }
12601262
@@ -1278,7 +1280,8 @@ static int fault_init_opcode_debugfs(struct hfi1_ibdev *ibd)
12781280
12791281static void fault_exit_packet_debugfs (struct hfi1_ibdev * ibd )
12801282{
1281- debugfs_remove_recursive (ibd -> fault_packet -> dir );
1283+ if (ibd -> fault_packet )
1284+ debugfs_remove_recursive (ibd -> fault_packet -> dir );
12821285 kfree (ibd -> fault_packet );
12831286 ibd -> fault_packet = NULL ;
12841287}
@@ -1304,6 +1307,7 @@ static int fault_init_packet_debugfs(struct hfi1_ibdev *ibd)
13041307 & ibd -> fault_opcode -> attr );
13051308 if (IS_ERR (ibd -> fault_packet -> dir )) {
13061309 kfree (ibd -> fault_packet );
1310+ ibd -> fault_packet = NULL ;
13071311 return - ENOENT ;
13081312 }
13091313
You can’t perform that action at this time.
0 commit comments