From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tilman Schmidt Subject: [PATCH 03/12] gigaset: linearize skb Date: Sun, 6 Sep 2009 20:58:52 +0200 (CEST) Message-ID: <20090906-patch-gigaset-03.tilman@imap.cc> References: <20090906-patch-gigaset-00.tilman@imap.cc> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Cc: Hansjoerg Lipp To: davem-fT/PcQaiUtIeIZ0/mPfg9Q@public.gmane.org, linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, netdev-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, i4ldeveloper-JX7+OpRa80SjiSfgN6Y1Ib39b6g2fGNp@public.gmane.org Return-path: In-Reply-To: <20090906-patch-gigaset-00.tilman-ZTO5kqT2PaM@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: i4ldeveloper-bounces-JX7+OpRa80SjiSfgN6Y1Ib39b6g2fGNp@public.gmane.org Errors-To: i4ldeveloper-bounces-JX7+OpRa80SjiSfgN6Y1Ib39b6g2fGNp@public.gmane.org List-Id: netdev.vger.kernel.org The code of the Gigaset driver assumes that sk_buff-s coming from the ISDN4Linux subsystem are always linear. Explicitly calling skb_linearize() is cheap if they are, but much more robust in case they ever aren't. Impact: robustness improvement Signed-off-by: Tilman Schmidt --- drivers/isdn/gigaset/i4l.c | 6 ++++++ 1 files changed, 6 insertions(+), 0 deletions(-) diff --git a/drivers/isdn/gigaset/i4l.c b/drivers/isdn/gigaset/i4l.c index 9b22f9c..322f16e 100644 --- a/drivers/isdn/gigaset/i4l.c +++ b/drivers/isdn/gigaset/i4l.c @@ -51,6 +51,12 @@ static int writebuf_from_LL(int driverID, int channel, int ack, return -ENODEV; } bcs = &cs->bcs[channel]; + + /* can only handle linear sk_buffs */ + if (skb_linearize(skb) < 0) { + dev_err(cs->dev, "%s: skb_linearize failed\n", __func__); + return -ENOMEM; + } len = skb->len; gig_dbg(DEBUG_LLDATA, -- 1.6.2.1.214.ge986c