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

[PATCH] prism54 Fix null pointer reference (Bug 100)

* prism54_get/set_debug_oid are missing checks for a null pointer.
  Reported in Bugzilla number 100.
parent daee0e35
......@@ -1942,7 +1942,7 @@ prism54_debug_get_oid(struct net_device *ndev, struct iw_request_info *info,
{
islpci_private *priv = netdev_priv(ndev);
struct islpci_mgmtframe *response = NULL;
int ret = -EIO, response_op = PIMFOR_OP_ERROR;
int ret = -EIO;
printk("%s: get_oid 0x%08X\n", ndev->name, priv->priv_oid);
data->length = 0;
......@@ -1952,9 +1952,7 @@ prism54_debug_get_oid(struct net_device *ndev, struct iw_request_info *info,
islpci_mgt_transaction(priv->ndev, PIMFOR_OP_GET,
priv->priv_oid, extra, 256,
&response);
response_op = response->header->operation;
printk("%s: ret: %i\n", ndev->name, ret);
printk("%s: response_op: %i\n", ndev->name, response_op);
if (ret || !response
|| response->header->operation == PIMFOR_OP_ERROR) {
if (response) {
......@@ -1991,16 +1989,20 @@ prism54_debug_set_oid(struct net_device *ndev, struct iw_request_info *info,
priv->priv_oid, extra, data->length,
&response);
printk("%s: ret: %i\n", ndev->name, ret);
if (ret || !response
|| response->header->operation == PIMFOR_OP_ERROR) {
if (response) {
islpci_mgt_release(response);
}
printk("%s: EIO\n", ndev->name);
ret = -EIO;
}
if (!ret) {
response_op = response->header->operation;
printk("%s: response_op: %i\n", ndev->name,
response_op);
islpci_mgt_release(response);
}
if (ret || response_op == PIMFOR_OP_ERROR) {
printk("%s: EIO\n", ndev->name);
ret = -EIO;
}
}
return (ret ? ret : -EINPROGRESS);
......
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