summaryrefslogtreecommitdiff
path: root/drivers/net/mctp/mctp-i2c.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/net/mctp/mctp-i2c.c')
-rw-r--r--drivers/net/mctp/mctp-i2c.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/net/mctp/mctp-i2c.c b/drivers/net/mctp/mctp-i2c.c
index 4dc057c121f5..e70fb6687994 100644
--- a/drivers/net/mctp/mctp-i2c.c
+++ b/drivers/net/mctp/mctp-i2c.c
@@ -588,6 +588,9 @@ static int mctp_i2c_header_create(struct sk_buff *skb, struct net_device *dev,
if (len > MCTP_I2C_MAXMTU)
return -EMSGSIZE;
+ if (!daddr || !saddr)
+ return -EINVAL;
+
lldst = *((u8 *)daddr);
llsrc = *((u8 *)saddr);