Commit 0e1825f4 authored by Shannon Nelson's avatar Shannon Nelson Committed by David S. Miller

ionic: only save good lif dentry

Don't save the lif->dentry until we know we have
a good value.

Fixes: 1a58e196 ("ionic: Add basic lif support")
Signed-off-by: default avatarShannon Nelson <snelson@pensando.io>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 2530ba5a
...@@ -228,7 +228,13 @@ DEFINE_SHOW_ATTRIBUTE(netdev); ...@@ -228,7 +228,13 @@ DEFINE_SHOW_ATTRIBUTE(netdev);
void ionic_debugfs_add_lif(struct ionic_lif *lif) 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, debugfs_create_file("netdev", 0400, lif->dentry,
lif->netdev, &netdev_fops); lif->netdev, &netdev_fops);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment