netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jean Delvare <khali@linux-fr.org>
To: netdev@vger.kernel.org, Josh Boyer <jwboyer@linux.vnet.ibm.com>
Cc: Jeff Garzik <jgarzik@pobox.com>
Subject: [PATCH] ibm_newemac: Fix dangerous struct assumption
Date: Mon, 6 Apr 2009 14:27:10 +0200	[thread overview]
Message-ID: <20090406142710.2d091038@hyperion.delvare> (raw)

The ibm_newemac driver includes code which assumes that the
work_struct which is included in every delayed_work is the first
member of that structure. This is currently the case but might change
in the future, so use to_delayed_work() instead, which doesn't make
such an assumption.

Signed-off-by: Jean Delvare <khali@linux-fr.org>
Cc: Josh Boyer <jwboyer@linux.vnet.ibm.com>
---
 drivers/net/ibm_newemac/core.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- linux-2.6.30-rc0.orig/drivers/net/ibm_newemac/core.c	2009-04-06 11:18:25.000000000 +0200
+++ linux-2.6.30-rc0/drivers/net/ibm_newemac/core.c	2009-04-06 13:29:29.000000000 +0200
@@ -1229,7 +1229,7 @@ static int emac_link_differs(struct emac
 static void emac_link_timer(struct work_struct *work)
 {
 	struct emac_instance *dev =
-		container_of((struct delayed_work *)work,
+		container_of(to_delayed_work(work),
 			     struct emac_instance, link_work);
 	int link_poll_interval;
 


-- 
Jean Delvare

             reply	other threads:[~2009-04-06 12:27 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-06 12:27 Jean Delvare [this message]
2009-04-07  0:43 ` [PATCH] ibm_newemac: Fix dangerous struct assumption David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090406142710.2d091038@hyperion.delvare \
    --to=khali@linux-fr.org \
    --cc=jgarzik@pobox.com \
    --cc=jwboyer@linux.vnet.ibm.com \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).