Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[IA64] mbcs_init() should give up unless running on sn2

CONFIG_SGI_MBCS is enabled in generic kernels, but the driver may
oops some other platforms. Check whether we are running on sn2
and bail out if we are not before doing anything dangerous.

Acked-by: Bruce Losure <blosure@americas.sgi.com>
Signed-off-by: Greg Edwards <edwardsg@sgi.com>
Signed-off-by: Tony Luck <tony.luck@intel.com>

authored by

Greg Edwards and committed by
Tony Luck
96f339c6 ed39f731

+3
+3
drivers/char/mbcs.c
··· 830 830 { 831 831 int rv; 832 832 833 + if (!ia64_platform_is("sn2")) 834 + return -ENODEV; 835 + 833 836 // Put driver into chrdevs[]. Get major number. 834 837 rv = register_chrdev(mbcs_major, DEVICE_NAME, &mbcs_ops); 835 838 if (rv < 0) {