diff options
author | Shannon Nelson <snelson@pensando.io> | 2020-03-20 05:31:50 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-03-22 05:56:04 +0300 |
commit | 0e1825f48ca7d38b7957b231148c7bd8c55fefed (patch) | |
tree | 47c61ff71670c9d9f56ebbb7fb1bca032661ed55 /drivers/net/ethernet/pensando | |
parent | 2530ba5af6040b24ad94818a188df1083a9aac0f (diff) | |
download | linux-0e1825f48ca7d38b7957b231148c7bd8c55fefed.tar.xz |
ionic: only save good lif dentry
Don't save the lif->dentry until we know we have
a good value.
Fixes: 1a58e196467f ("ionic: Add basic lif support")
Signed-off-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/ethernet/pensando')
-rw-r--r-- | drivers/net/ethernet/pensando/ionic/ionic_debugfs.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/ethernet/pensando/ionic/ionic_debugfs.c b/drivers/net/ethernet/pensando/ionic/ionic_debugfs.c index bc03cecf80cc..5f8fc58d42b3 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_debugfs.c +++ b/drivers/net/ethernet/pensando/ionic/ionic_debugfs.c @@ -228,7 +228,13 @@ DEFINE_SHOW_ATTRIBUTE(netdev); void ionic_debugfs_add_lif(struct ionic_lif *lif) { - lif->dentry = debugfs_create_dir(lif->name, lif->ionic->dentry); + struct dentry *lif_dentry; + + lif_dentry = debugfs_create_dir(lif->name, lif->ionic->dentry); + if (IS_ERR_OR_NULL(lif_dentry)) + return; + lif->dentry = lif_dentry; + debugfs_create_file("netdev", 0400, lif->dentry, lif->netdev, &netdev_fops); } |