From patchwork Mon Dec 15 01:57:37 2008 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [RFC,8/9] irda: Add a WARN_ON when our head room is too small Date: Sun, 14 Dec 2008 15:57:37 -0000 From: Samuel Ortiz X-Patchwork-Id: 13969 Message-Id: <20081215015903.905115415@sortiz.org> To: "David S. Miller" Cc: netdev@vger.kernel.org, irda-users@lists.sourceforge.net Signed-off-by: Samuel Ortiz --- include/net/irda/irda_device.h | 1 + 1 files changed, 1 insertions(+), 0 deletions(-) diff --git a/include/net/irda/irda_device.h b/include/net/irda/irda_device.h index 3bbf695..28c690c 100644 --- a/include/net/irda/irda_device.h +++ b/include/net/irda/irda_device.h @@ -233,6 +233,7 @@ void irda_setup_dma(int channel, dma_addr_t buffer, int count, int mode); static inline struct irda_skb_cb *irda_get_skb_cb(struct sk_buff *skb) { + WARN_ON(skb_headroom(skb) < sizeof(struct irda_skb_cb)); return (struct irda_skb_cb *)(skb->data - sizeof(struct irda_skb_cb)); }