net/rds: NULL pointer de-reference in rds_ib_add_one()
The parent field of a struct device may be NULL. The macro ibdev_to_node() should check for that. Signed-off-by: Ka-Cheong Poon <ka-cheong.poon@oracle.com> Acked-by: Santosh Shilimkar <santosh.shilimkar@oracle.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
b3a9e3b962
commit
33cf601da7
|
@ -264,7 +264,13 @@ struct rds_ib_device {
|
|||
int *vector_load;
|
||||
};
|
||||
|
||||
#define ibdev_to_node(ibdev) dev_to_node((ibdev)->dev.parent)
|
||||
static inline int ibdev_to_node(struct ib_device *ibdev)
|
||||
{
|
||||
struct device *parent;
|
||||
|
||||
parent = ibdev->dev.parent;
|
||||
return parent ? dev_to_node(parent) : NUMA_NO_NODE;
|
||||
}
|
||||
#define rdsibdev_to_node(rdsibdev) ibdev_to_node(rdsibdev->dev)
|
||||
|
||||
/* bits for i_ack_flags */
|
||||
|
|
Loading…
Reference in New Issue