Skip to content

Commit

Permalink
ionic: only save good lif dentry
Browse files Browse the repository at this point in the history
Don't save the lif->dentry until we know we have
a good value.

Fixes: 1a58e19 ("ionic: Add basic lif support")
Signed-off-by: Shannon Nelson <snelson@pensando.io>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Shannon Nelson authored and David S. Miller committed Mar 22, 2020
1 parent 2530ba5 commit 0e1825f
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion drivers/net/ethernet/pensando/ionic/ionic_debugfs.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 0e1825f

Please sign in to comment.