Commit 0eba26af authored by Margit Schubert-While's avatar Margit Schubert-While Committed by Jeff Garzik

[PATCH] prism54 Fix reference to uninitialized pointer

* oid_mgt.c is calling islpci_mgt_transaction passing the address
  of a pointer to the management frame. This is not being
  initialized by the caller. The callee only updates this
  pointer when successful. When not, boom.

* Being ultracautious again, not only initialize in the caller,
  also null out the pointer unconditionally in the callee.
parent a6ba40b5
...@@ -458,6 +458,8 @@ islpci_mgt_transaction(struct net_device *ndev, ...@@ -458,6 +458,8 @@ islpci_mgt_transaction(struct net_device *ndev,
int err; int err;
DEFINE_WAIT(wait); DEFINE_WAIT(wait);
*recvframe = NULL;
if (down_interruptible(&priv->mgmt_sem)) if (down_interruptible(&priv->mgmt_sem))
return -ERESTARTSYS; return -ERESTARTSYS;
......
...@@ -408,7 +408,7 @@ int ...@@ -408,7 +408,7 @@ int
mgt_set_request(islpci_private *priv, enum oid_num_t n, int extra, void *data) mgt_set_request(islpci_private *priv, enum oid_num_t n, int extra, void *data)
{ {
int ret = 0; int ret = 0;
struct islpci_mgmtframe *response; struct islpci_mgmtframe *response = NULL;
int response_op = PIMFOR_OP_ERROR; int response_op = PIMFOR_OP_ERROR;
int dlen; int dlen;
void *cache, *_data = data; void *cache, *_data = data;
...@@ -620,7 +620,7 @@ static enum oid_num_t commit_part2[] = { ...@@ -620,7 +620,7 @@ static enum oid_num_t commit_part2[] = {
static int static int
mgt_update_addr(islpci_private *priv) mgt_update_addr(islpci_private *priv)
{ {
struct islpci_mgmtframe *res; struct islpci_mgmtframe *res = NULL;
int ret; int ret;
ret = islpci_mgt_transaction(priv->ndev, PIMFOR_OP_GET, ret = islpci_mgt_transaction(priv->ndev, PIMFOR_OP_GET,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment