From 7bfbba1e607190bf542f56e87ff1ebc6d82388b5 Mon Sep 17 00:00:00 2001 From: Mandy Lavi Date: Mon, 19 Jan 2015 14:37:45 +0200 Subject: fmd: fix reading fm_port_ipv4_opt to not panic Change-Id: Id4166dad03d6e51202caa367de188ff8486fa9dc Signed-off-by: Mandy Lavi Reviewed-on: http://git.am.freescale.net:8181/28750 Tested-by: Review Code-CDREVIEW Reviewed-by: Igal Liberman Reviewed-by: Honghua Yin diff --git a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_sysfs_fm_port.c b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_sysfs_fm_port.c index ae4bb87..0cdf6a8 100644 --- a/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_sysfs_fm_port.c +++ b/drivers/net/ethernet/freescale/fman/src/wrapper/lnxwrp_sysfs_fm_port.c @@ -692,6 +692,11 @@ static ssize_t show_fm_port_ipv4_options(struct device *dev, if (!p_LnxWrpFmPortDev->h_Dev) { n = snprintf(buf, PAGE_SIZE, "\tFM Port not configured...\n"); return n; + } else if (((t_FmPort *)p_LnxWrpFmPortDev->h_Dev)->p_ParamsPage + == NULL) { + n = snprintf(buf, PAGE_SIZE, + "\tPort: FMan-controller params page not set\n"); + return n; } else { n = snprintf(buf, PAGE_SIZE, "Counter for fragmented pkt with IP header options\n"); -- cgit v0.10.2