[lldp-devel] [PATCH 6/8] crtl_iface check for client_cmd function

Thomas Richter tmricht at linux.vnet.ibm.com
Fri Apr 5 11:43:34 UTC 2013


Check for a valid pointer when the client_cmd function is
used.

Signed-off-by: Thomas Richter <tmricht at linux.vnet.ibm.com>
---
 ctrl_iface.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/ctrl_iface.c b/ctrl_iface.c
index 4d4a851..e02f036 100644
--- a/ctrl_iface.c
+++ b/ctrl_iface.c
@@ -118,7 +118,7 @@ int clif_iface_module(struct clif_data *clifd,
 
 	mod = find_module_by_id(&lldp_head, module_id);
 
-	if (mod)
+	if (mod && mod->ops && mod->ops->client_cmd)
 		return  (mod->ops->client_cmd)(clifd, from, fromlen,
 			 cmd_start, cmd_len, rbuf+strlen(rbuf), rlen);
 	else
-- 
1.7.1



More information about the lldp-devel mailing list