Bluetooth: Use IS_ERR_OR_NULL for checking bt_debugfs
Make sure to use IS_ERR_OR_NULL for checking the existing of the root debugfs dentry bt_debugfs. Signed-off-by: Marcel Holtmann <marcel@holtmann.org> Signed-off-by: Johan Hedberg <johan.hedberg@intel.com>
This commit is contained in:

committed by
Johan Hedberg

parent
47219839b4
commit
1120e4bfa5
@@ -1051,15 +1051,15 @@ int __init rfcomm_init_sockets(void)
|
||||
goto error;
|
||||
}
|
||||
|
||||
if (bt_debugfs) {
|
||||
rfcomm_sock_debugfs = debugfs_create_file("rfcomm", 0444,
|
||||
bt_debugfs, NULL, &rfcomm_sock_debugfs_fops);
|
||||
if (!rfcomm_sock_debugfs)
|
||||
BT_ERR("Failed to create RFCOMM debug file");
|
||||
}
|
||||
|
||||
BT_INFO("RFCOMM socket layer initialized");
|
||||
|
||||
if (IS_ERR_OR_NULL(bt_debugfs))
|
||||
return 0;
|
||||
|
||||
rfcomm_sock_debugfs = debugfs_create_file("rfcomm", 0444,
|
||||
bt_debugfs, NULL,
|
||||
&rfcomm_sock_debugfs_fops);
|
||||
|
||||
return 0;
|
||||
|
||||
error:
|
||||
|
Reference in New Issue
Block a user