zdev: Fix segfault with unknown qeth attribute

This patch fixes a segfault in the qeth get_layer function that occurs
when an unknown attribute is used in combination with the force option.

Signed-off-by: Hans Wippel <hwippel@linux.vnet.ibm.com>
Reviewed-by: Peter Oberparleiter <oberpar@linux.vnet.ibm.com>
Signed-off-by: Michael Holzheu <holzheu@linux.vnet.ibm.com>
This commit is contained in:
Hans Wippel
2017-09-15 18:05:12 +02:00
committed by Michael Holzheu
parent e831269e74
commit c0dc514af8

View File

@@ -1071,7 +1071,11 @@ static exit_code_t setting_ineffective(struct setting *s, int layer2)
static enum qeth_layer_type get_layer_type(struct setting *s)
{
struct qeth_attrib_data *data = s->attrib->st_data;
struct qeth_attrib_data *data;
if (!s->attrib)
return layer_any;
data = s->attrib->st_data;
if (!data)
return layer_any;