From: Jean Delvare Date: Mon, 6 Apr 2009 02:27:10 +0000 (+0000) Subject: ibm_newemac: Fix dangerous struct assumption X-Git-Tag: upstream/snapshot3+hdmi~19400^2~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=10fd9d7ec48194754de6497ded2ef53cbd2c313e;p=platform%2Fadaptation%2Frenesas_rcar%2Frenesas_kernel.git ibm_newemac: Fix dangerous struct assumption 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 Cc: Josh Boyer Signed-off-by: David S. Miller --- diff --git a/drivers/net/ibm_newemac/core.c b/drivers/net/ibm_newemac/core.c index a815e17..77e4b5b 100644 --- a/drivers/net/ibm_newemac/core.c +++ b/drivers/net/ibm_newemac/core.c @@ -1229,7 +1229,7 @@ static int emac_link_differs(struct emac_instance *dev) 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;