From: Asias He Date: Tue, 23 Apr 2013 20:33:52 +0000 (+0000) Subject: VSOCK: Fix misc device registration X-Git-Tag: omap-for-v3.10/dt-fixes-for-merge-window~77^2~15^2~11 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6ad0b2f7fdfd95fe3107367f8aed252e94c3f654;p=pandora-kernel.git VSOCK: Fix misc device registration When we call vsock_core_init to init VSOCK the second time, vsock_device.minor still points to the old dynamically allocated minor number. misc_register will allocate it for us successfully as if we were asking for a static one. However, when other user call misc_register to allocate a dynamic minor number, it will give the one used by vsock_core_init(), causing this: [ 405.470687] WARNING: at fs/sysfs/dir.c:536 sysfs_add_one+0xcc/0xf0() [ 405.470689] Hardware name: OptiPlex 790 [ 405.470690] sysfs: cannot create duplicate filename '/dev/char/10:54' Always set vsock_device.minor to MISC_DYNAMIC_MINOR before we register. Cc: "David S. Miller" Cc: Andy King Cc: Dmitry Torokhov Cc: Reilly Grant Cc: netdev@vger.kernel.org Cc: linux-kernel@vger.kernel.org Signed-off-by: Asias He Acked-by: Dmitry Torokhov Signed-off-by: David S. Miller --- Reading git-diff-tree failed