/* * Linux WiMAX * Debugfs support * * * Copyright (C) 2005-2006 Intel Corporation * Inaky Perez-Gonzalez * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License version * 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. */ #include #include #include "wimax-internal.h" #define D_SUBMODULE debugfs #include "debug-levels.h" #define __debugfs_register(prefix, name, parent) \ do { \ result = d_level_register_debugfs(prefix, name, parent); \ if (result < 0) \ goto error; \ } while (0) int wimax_debugfs_add(struct wimax_dev *wimax_dev) { int result; struct net_device *net_dev = wimax_dev->net_dev; struct device *dev = net_dev->dev.parent; struct dentry *dentry; char buf[128]; snprintf(buf, sizeof(buf), "wimax:%s", net_dev->name); dentry = debugfs_create_dir(buf, NULL); result = PTR_ERR(dentry); if (IS_ERR(dentry)) { if (result == -ENODEV) result = 0; /* No debugfs support */ else dev_err(dev, "Can't create debugfs dentry: %d\n", result); goto out; } wimax_dev->debugfs_dentry = dentry; __debugfs_register("wimax_dl_", debugfs, dentry); __debugfs_register("wimax_dl_", id_table, dentry); __debugfs_register("wimax_dl_", op_msg, dentry); __debugfs_register("wimax_dl_", op_reset, dentry); __debugfs_register("wimax_dl_", op_rfkill, dentry); __debugfs_register("wimax_dl_", op_state_get, dentry); __debugfs_register("wimax_dl_", stack, dentry); result = 0; out: return result; error: debugfs_remove_recursive(wimax_dev->debugfs_dentry); return result; } void wimax_debugfs_rm(struct wimax_dev *wimax_dev) { debugfs_remove_recursive(wimax_dev->debugfs_dentry); } /ircomm_core.h'>
diff options
context:
space:
mode:
authorVincent <vincent.stehle@laposte.net>2017-01-30 15:06:43 +0100
committerDavid S. Miller <davem@davemloft.net>2017-01-31 13:07:40 -0500
commitc73e44269369e936165f0f9b61f1f09a11dae01c (patch)
treee2188e900ba06302f8ed2746cb07edd3efbc5c35 /include/net/irda/ircomm_core.h
parent040587af31228d82c52267f717c9fcdb65f36335 (diff)
net: thunderx: avoid dereferencing xcv when NULL
This fixes the following smatch and coccinelle warnings: drivers/net/ethernet/cavium/thunder/thunder_xcv.c:119 xcv_setup_link() error: we previously assumed 'xcv' could be null (see line 118) [smatch] drivers/net/ethernet/cavium/thunder/thunder_xcv.c:119:16-20: ERROR: xcv is NULL but dereferenced. [coccinelle] Fixes: 6465859aba1e66a5 ("net: thunderx: Add RGMII interface type support") Signed-off-by: Vincent Stehlé <vincent.stehle@laposte.net> Cc: Sunil Goutham <sgoutham@cavium.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/irda/ircomm_core.h')