• L
    HID: fix a potential bug in pointer casting · 3ba5619f
    Li Zefan 提交于
    Don't directly cast list_head * to foo *, this works only when list
    is the first member of struct foo, and we should not make the assumption
    how members are ordered in the structure.
    
    i.e. struct *f = (struct *f)pos will work if:
    	struct foo {
    		struct list_head list;
    		int i;
    	};
    
    but will fail if:
    	struct foo {
    		int i;
    		struct list_head list;
    	}
    Signed-off-by: NLi Zefan <lizf@cn.fujitsu.com>
    Signed-off-by: NJiri Kosina <jkosina@suse.cz>
    3ba5619f
hid-tmff.c 5.7 KB