From patchwork Sun Feb 8 09:14:07 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: =?utf-8?q?Michael_B=C3=BCsch?= X-Patchwork-Id: 437684 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming@ozlabs.org Delivered-To: patchwork-incoming@ozlabs.org Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 86087140129 for ; Sun, 8 Feb 2015 20:53:49 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755898AbbBHJxp (ORCPT ); Sun, 8 Feb 2015 04:53:45 -0500 Received: from bues.ch ([80.190.117.144]:57156 "EHLO bues.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755732AbbBHJxo (ORCPT ); Sun, 8 Feb 2015 04:53:44 -0500 X-Greylist: delayed 2201 seconds by postgrey-1.27 at vger.kernel.org; Sun, 08 Feb 2015 04:53:44 EST Received: by bues.ch with esmtpsa (Exim 4.80) (envelope-from ) id 1YKNz9-000100-IO; Sun, 08 Feb 2015 10:16:59 +0100 Date: Sun, 8 Feb 2015 10:14:07 +0100 From: Michael =?UTF-8?B?QsO8c2No?= To: "David S. Miller" Cc: netdev@vger.kernel.org, Hannes Frederic Sowa Subject: [PATCH] rt6_probe_deferred: Do not depend on struct ordering Message-ID: <20150208101407.517bcfa7@wiggum> X-Mailer: Claws Mail 3.11.1 (GTK+ 2.24.25; x86_64-pc-linux-gnu) MIME-Version: 1.0 Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org rt6_probe allocates a struct __rt6_probe_work and schedules a work handler rt6_probe_deferred. But rt6_probe_deferred kfree's the struct work_struct instead of struct __rt6_probe_work. This works, because struct work_struct is the first element of struct __rt6_probe_work. Change it to kfree struct __rt6_probe_work to not implicitly depend on struct work_struct being the first element. This does not affect the generated code. Signed-off-by: Michael Buesch --- The affected code was introduced in c2f17e827b419918c856131f592df9521e1a38e3 Index: linux/net/ipv6/route.c =================================================================== --- linux.orig/net/ipv6/route.c +++ linux/net/ipv6/route.c @@ -499,7 +499,7 @@ static void rt6_probe_deferred(struct wo addrconf_addr_solict_mult(&work->target, &mcaddr); ndisc_send_ns(work->dev, NULL, &work->target, &mcaddr, NULL); dev_put(work->dev); - kfree(w); + kfree(work); } static void rt6_probe(struct rt6_info *rt)