File tree Expand file tree Collapse file tree 5 files changed +16
-7
lines changed Expand file tree Collapse file tree 5 files changed +16
-7
lines changed Original file line number Diff line number Diff line change @@ -242,10 +242,14 @@ static void add_conn(void *data)
242
242
struct hci_conn * conn = data ;
243
243
int i ;
244
244
245
- device_register (& conn -> dev );
245
+ if (device_register (& conn -> dev ) < 0 ) {
246
+ BT_ERR ("Failed to register connection device" );
247
+ return ;
248
+ }
246
249
247
250
for (i = 0 ; conn_attrs [i ]; i ++ )
248
- device_create_file (& conn -> dev , conn_attrs [i ]);
251
+ if (device_create_file (& conn -> dev , conn_attrs [i ]) < 0 )
252
+ BT_ERR ("Failed to create connection attribute" );
249
253
}
250
254
251
255
void hci_conn_add_sysfs (struct hci_conn * conn )
@@ -312,7 +316,8 @@ int hci_register_sysfs(struct hci_dev *hdev)
312
316
return err ;
313
317
314
318
for (i = 0 ; bt_attrs [i ]; i ++ )
315
- device_create_file (dev , bt_attrs [i ]);
319
+ if (device_create_file (dev , bt_attrs [i ]) < 0 )
320
+ BT_ERR ("Failed to create device attribute" );
316
321
317
322
return 0 ;
318
323
}
Original file line number Diff line number Diff line change @@ -2216,7 +2216,8 @@ static int __init l2cap_init(void)
2216
2216
goto error ;
2217
2217
}
2218
2218
2219
- class_create_file (bt_class , & class_attr_l2cap );
2219
+ if (class_create_file (bt_class , & class_attr_l2cap ) < 0 )
2220
+ BT_ERR ("Failed to create L2CAP info file" );
2220
2221
2221
2222
BT_INFO ("L2CAP ver %s" , VERSION );
2222
2223
BT_INFO ("L2CAP socket layer initialized" );
Original file line number Diff line number Diff line change @@ -2058,7 +2058,8 @@ static int __init rfcomm_init(void)
2058
2058
2059
2059
kernel_thread (rfcomm_run , NULL , CLONE_KERNEL );
2060
2060
2061
- class_create_file (bt_class , & class_attr_rfcomm_dlc );
2061
+ if (class_create_file (bt_class , & class_attr_rfcomm_dlc ) < 0 )
2062
+ BT_ERR ("Failed to create RFCOMM info file" );
2062
2063
2063
2064
rfcomm_init_sockets ();
2064
2065
Original file line number Diff line number Diff line change @@ -944,7 +944,8 @@ int __init rfcomm_init_sockets(void)
944
944
if (err < 0 )
945
945
goto error ;
946
946
947
- class_create_file (bt_class , & class_attr_rfcomm );
947
+ if (class_create_file (bt_class , & class_attr_rfcomm ) < 0 )
948
+ BT_ERR ("Failed to create RFCOMM info file" );
948
949
949
950
BT_INFO ("RFCOMM socket layer initialized" );
950
951
Original file line number Diff line number Diff line change @@ -967,7 +967,8 @@ static int __init sco_init(void)
967
967
goto error ;
968
968
}
969
969
970
- class_create_file (bt_class , & class_attr_sco );
970
+ if (class_create_file (bt_class , & class_attr_sco ) < 0 )
971
+ BT_ERR ("Failed to create SCO info file" );
971
972
972
973
BT_INFO ("SCO (Voice Link) ver %s" , VERSION );
973
974
BT_INFO ("SCO socket layer initialized" );
You can’t perform that action at this time.
0 commit comments