aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2011-01-17 20:12:32 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2011-01-17 20:22:39 +0100
commitc914ea665a9bb07bd8c39836ec83d142cd2adc6c (patch)
tree0404e91ce0f0c86e0732eea16ee3d95d01f858c0
parente13c5aa4185ba44319813a21132b03986c5e09c8 (diff)
mtp: Do not send anything in case the there is no link
If there is no usable link in the linkset we should not try to send. This assumes that all incoming packages come from links that are up. We do not check this right now but we will have to check this.
-rw-r--r--src/mtp_layer3.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/mtp_layer3.c b/src/mtp_layer3.c
index c3f3878..742da7d 100644
--- a/src/mtp_layer3.c
+++ b/src/mtp_layer3.c
@@ -534,6 +534,9 @@ static int mtp_int_submit(struct mtp_link_set *link, int pc, int sls, int type,
struct mtp_level_3_hdr *hdr;
struct msgb *msg;
+ if (!link->slc[sls % 16])
+ return -1;
+
msg = mtp_msg_alloc(link);
if (!msg)
return -1;