IB/mthca: Handle -ENOMEM in forward_trap()

ib_create_send_mad() can return ERR_PTR(-ENOMEM) here.

Signed-off-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Roland Dreier <rolandd@cisco.com>
This commit is contained in:
Dan Carpenter 2011-01-10 17:42:10 -08:00 коммит произвёл Roland Dreier
Родитель 3c0eee3fe6
Коммит d0444f1527
1 изменённых файлов: 2 добавлений и 0 удалений

Просмотреть файл

@ -171,6 +171,8 @@ static void forward_trap(struct mthca_dev *dev,
if (agent) {
send_buf = ib_create_send_mad(agent, qpn, 0, 0, IB_MGMT_MAD_HDR,
IB_MGMT_MAD_DATA, GFP_ATOMIC);
if (IS_ERR(send_buf))
return;
/*
* We rely here on the fact that MLX QPs don't use the
* address handle after the send is posted (this is