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:
Marcel Holtmann 2013-10-17 17:24:16 -07:00 committed by Johan Hedberg
commit 1120e4bfa5
4 changed files with 25 additions and 27 deletions

View file

@ -6833,12 +6833,11 @@ int __init l2cap_init(void)
if (err < 0)
return err;
if (bt_debugfs) {
l2cap_debugfs = debugfs_create_file("l2cap", 0444, bt_debugfs,
NULL, &l2cap_debugfs_fops);
if (!l2cap_debugfs)
BT_ERR("Failed to create L2CAP debug file");
}
if (IS_ERR_OR_NULL(bt_debugfs))
return 0;
l2cap_debugfs = debugfs_create_file("l2cap", 0444, bt_debugfs,
NULL, &l2cap_debugfs_fops);
return 0;
}