Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S261699AbVDKNc2 (ORCPT ); Mon, 11 Apr 2005 09:32:28 -0400 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S261747AbVDKNc2 (ORCPT ); Mon, 11 Apr 2005 09:32:28 -0400 Received: from postel.suug.ch ([195.134.158.23]:2492 "EHLO postel.suug.ch") by vger.kernel.org with ESMTP id S261699AbVDKNcS (ORCPT ); Mon, 11 Apr 2005 09:32:18 -0400 Date: Mon, 11 Apr 2005 15:32:39 +0200 From: Thomas Graf To: Evgeniy Polyakov Cc: netdev@oss.sgi.com, Greg KH , Jamal Hadi Salim , Kay Sievers , Herbert Xu , James Morris , Guillaume Thouvenin , linux-kernel@vger.kernel.org, Andrew Morton , Jay Lan Subject: Re: [1/1] connector/CBUS: new messaging subsystem. Revision number next. Message-ID: <20050411133239.GM26731@postel.suug.ch> References: <20050411125932.GA19538@uganda.factory.vocord.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20050411125932.GA19538@uganda.factory.vocord.ru> Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1030 Lines: 32 * Evgeniy Polyakov <20050411125932.GA19538@uganda.factory.vocord.ru> 2005-04-11 16:59 > + size = NLMSG_SPACE(sizeof(*msg) + msg->len); > + > + skb = alloc_skb(size, gfp_mask); > + if (!skb) { > + printk(KERN_ERR "Failed to allocate new skb with size=%u.\n", size); > + return -ENOMEM; > + } > + > + nlh = NLMSG_PUT(skb, 0, msg->seq, NLMSG_DONE, size - sizeof(*nlh)); Needs same fix. > + size0 = sizeof(*msg) + sizeof(*ctl) + 3*sizeof(*req); > + > + size = NLMSG_SPACE(size0); > + > + skb = alloc_skb(size, GFP_ATOMIC); > + if (!skb) { > + printk(KERN_ERR "Failed to allocate new skb with size=%u.\n", size); > + > + return -ENOMEM; > + } > + > + nlh = NLMSG_PUT(skb, 0, 0x123, NLMSG_DONE, size - NLMSG_ALIGN(sizeof(*nlh))); Just pass size0 instead of reverting the calculation. - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/