mirror of
https://github.com/torvalds/linux.git
synced 2026-04-18 23:03:57 -04:00
netdevsim: correctly check return value of debugfs_create_dir
- Checking return value with IS_ERROR_OR_NULL - Added error handling where it was not handled Signed-off-by: Prashant Bhole <bhole_prashant_q7@lab.ntt.co.jp> Acked-by: Jakub Kicinski <jakub.kicinski@netronome.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
afb4c97d90
commit
9ee1942cb3
@@ -151,6 +151,8 @@ static int nsim_init(struct net_device *dev)
|
||||
|
||||
ns->netdev = dev;
|
||||
ns->ddir = debugfs_create_dir(netdev_name(dev), nsim_ddir);
|
||||
if (IS_ERR_OR_NULL(ns->ddir))
|
||||
return -ENOMEM;
|
||||
|
||||
err = nsim_bpf_init(ns);
|
||||
if (err)
|
||||
@@ -469,8 +471,8 @@ static int __init nsim_module_init(void)
|
||||
int err;
|
||||
|
||||
nsim_ddir = debugfs_create_dir(DRV_NAME, NULL);
|
||||
if (IS_ERR(nsim_ddir))
|
||||
return PTR_ERR(nsim_ddir);
|
||||
if (IS_ERR_OR_NULL(nsim_ddir))
|
||||
return -ENOMEM;
|
||||
|
||||
err = bus_register(&nsim_bus);
|
||||
if (err)
|
||||
|
||||
Reference in New Issue
Block a user