xen/hvc: Fix error cases around HVM_PARAM_CONSOLE_PFN
authorKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Wed, 23 May 2012 16:55:38 +0000 (12:55 -0400)
committerKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Thu, 24 May 2012 18:15:35 +0000 (14:15 -0400)
We weren't resetting the parameter to be passed in to a
known default. Nor were we checking the return value of
hvm_get_parameter.

CC: stable@kernel.org
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
drivers/tty/hvc/hvc_xen.c

index afc7fc27aa52e25136dfe1d762281d5150dcc474..3277f0eec4a704d352e63f196960e71daa62f32b 100644 (file)
@@ -219,7 +219,8 @@ static int xen_hvm_console_init(void)
        if (r < 0)
                goto err;
        info->evtchn = v;
-       hvm_get_parameter(HVM_PARAM_CONSOLE_PFN, &v);
+       v = 0;
+       r = hvm_get_parameter(HVM_PARAM_CONSOLE_PFN, &v);
        if (r < 0)
                goto err;
        mfn = v;