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

s390/lcs: Fix null-pointer access in msg

An attempt to configure a CTC device as LCS results in the
following error message:

(null): Detecting a network adapter for LCS devices failed
with rc=-5 (0xfffffffb)

"(null)" results from access to &card->dev->dev in lcs_new_device()
which is only initialized later in the function. Fix this by using
&ccwgdev->dev instead which is initialized before lcs_new_device()
is called.

Signed-off-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Signed-off-by: Ursula Braun <ursula.braun@de.ibm.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Peter Oberparleiter and committed by
David S. Miller
89a2a8e7 ffb95251

+1 -1
+1 -1
drivers/s390/net/lcs.c
··· 2150 2150 rc = lcs_detect(card); 2151 2151 if (rc) { 2152 2152 LCS_DBF_TEXT(2, setup, "dtctfail"); 2153 - dev_err(&card->dev->dev, 2153 + dev_err(&ccwgdev->dev, 2154 2154 "Detecting a network adapter for LCS devices" 2155 2155 " failed with rc=%d (0x%x)\n", rc, rc); 2156 2156 lcs_stopcard(card);