Skip to content

Commit

Permalink
Merge tag 'hsi-for-4.12' of git://git.kernel.org/pub/scm/linux/kernel…
Browse files Browse the repository at this point in the history
…/git/sre/linux-hsi

Pull HSI fix from Sebastian Reichel:
 "Fix double free fix in ssi-protocol"

* tag 'hsi-for-4.12' of git://git.kernel.org/pub/scm/linux/kernel/git/sre/linux-hsi:
  HSI: ssi_protocol: double free in ssip_pn_xmit()
  • Loading branch information
Linus Torvalds committed May 1, 2017
2 parents 7f2ebde + 3026050 commit 5c6ba7d
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/hsi/clients/ssi_protocol.c
Original file line number Diff line number Diff line change
Expand Up @@ -980,7 +980,7 @@ static int ssip_pn_xmit(struct sk_buff *skb, struct net_device *dev)
goto drop;
/* Pad to 32-bits - FIXME: Revisit*/
if ((skb->len & 3) && skb_pad(skb, 4 - (skb->len & 3)))
goto drop;
goto inc_dropped;

/*
* Modem sends Phonet messages over SSI with its own endianess...
Expand Down Expand Up @@ -1032,8 +1032,9 @@ static int ssip_pn_xmit(struct sk_buff *skb, struct net_device *dev)
drop2:
hsi_free_msg(msg);
drop:
dev->stats.tx_dropped++;
dev_kfree_skb(skb);
inc_dropped:
dev->stats.tx_dropped++;

return 0;
}
Expand Down

0 comments on commit 5c6ba7d

Please sign in to comment.