Linux wireless drivers development
 help / color / mirror / Atom feed
* [patch] wcn36xx: missing unlocks on error paths
@ 2013-11-05 20:21 Dan Carpenter
  2013-11-06  7:38 ` Eugene Krasnikov
  0 siblings, 1 reply; 3+ messages in thread
From: Dan Carpenter @ 2013-11-05 20:21 UTC (permalink / raw)
  To: Eugene Krasnikov
  Cc: John W. Linville, wcn36xx, linux-wireless, kernel-janitors

There are several places which are missing unlocks.

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
index f8c3a10..de9eb2c 100644
--- a/drivers/net/wireless/ath/wcn36xx/smd.c
+++ b/drivers/net/wireless/ath/wcn36xx/smd.c
@@ -1286,7 +1286,8 @@ int wcn36xx_smd_send_beacon(struct wcn36xx *wcn, struct ieee80211_vif *vif,
 	} else {
 		wcn36xx_err("Beacon is to big: beacon size=%d\n",
 			      msg_body.beacon_length);
-		return -ENOMEM;
+		ret = -ENOMEM;
+		goto out;
 	}
 	memcpy(msg_body.bssid, vif->addr, ETH_ALEN);
 
@@ -1327,7 +1328,8 @@ int wcn36xx_smd_update_proberesp_tmpl(struct wcn36xx *wcn,
 	if (skb->len > BEACON_TEMPLATE_SIZE) {
 		wcn36xx_warn("probe response template is too big: %d\n",
 			     skb->len);
-		return -E2BIG;
+		ret = -E2BIG;
+		goto out;
 	}
 
 	msg.probe_resp_template_len = skb->len;
@@ -1606,7 +1608,8 @@ int wcn36xx_smd_keep_alive_req(struct wcn36xx *wcn,
 		/* TODO: it also support ARP response type */
 	} else {
 		wcn36xx_warn("unknow keep alive packet type %d\n", packet_type);
-		return -EINVAL;
+		ret = -EINVAL;
+		goto out;
 	}
 
 	PREPARE_HAL_BUF(wcn->hal_buf, msg_body);

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [patch] wcn36xx: missing unlocks on error paths
  2013-11-05 20:21 [patch] wcn36xx: missing unlocks on error paths Dan Carpenter
@ 2013-11-06  7:38 ` Eugene Krasnikov
  2013-11-06  7:40   ` Eugene Krasnikov
  0 siblings, 1 reply; 3+ messages in thread
From: Eugene Krasnikov @ 2013-11-06  7:38 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: John W. Linville, wcn36xx, linux-wireless, kernel-janitors

Looks good to me, thanx!

On Tue, Nov 5, 2013 at 8:21 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
> There are several places which are missing unlocks.
>
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>
> diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
> index f8c3a10..de9eb2c 100644
> --- a/drivers/net/wireless/ath/wcn36xx/smd.c
> +++ b/drivers/net/wireless/ath/wcn36xx/smd.c
> @@ -1286,7 +1286,8 @@ int wcn36xx_smd_send_beacon(struct wcn36xx *wcn, struct ieee80211_vif *vif,
>         } else {
>                 wcn36xx_err("Beacon is to big: beacon size=%d\n",
>                               msg_body.beacon_length);
> -               return -ENOMEM;
> +               ret = -ENOMEM;
> +               goto out;
>         }
>         memcpy(msg_body.bssid, vif->addr, ETH_ALEN);
>
> @@ -1327,7 +1328,8 @@ int wcn36xx_smd_update_proberesp_tmpl(struct wcn36xx *wcn,
>         if (skb->len > BEACON_TEMPLATE_SIZE) {
>                 wcn36xx_warn("probe response template is too big: %d\n",
>                              skb->len);
> -               return -E2BIG;
> +               ret = -E2BIG;
> +               goto out;
>         }
>
>         msg.probe_resp_template_len = skb->len;
> @@ -1606,7 +1608,8 @@ int wcn36xx_smd_keep_alive_req(struct wcn36xx *wcn,
>                 /* TODO: it also support ARP response type */
>         } else {
>                 wcn36xx_warn("unknow keep alive packet type %d\n", packet_type);
> -               return -EINVAL;
> +               ret = -EINVAL;
> +               goto out;
>         }
>
>         PREPARE_HAL_BUF(wcn->hal_buf, msg_body);



-- 
Best regards,
Eugene

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [patch] wcn36xx: missing unlocks on error paths
  2013-11-06  7:38 ` Eugene Krasnikov
@ 2013-11-06  7:40   ` Eugene Krasnikov
  0 siblings, 0 replies; 3+ messages in thread
From: Eugene Krasnikov @ 2013-11-06  7:40 UTC (permalink / raw)
  To: Dan Carpenter; +Cc: John W. Linville, wcn36xx, linux-wireless, kernel-janitors

Forgot to mention that there was an overlap with a patch from Wei
Yongjun but that i will resolve myself because i was too slow with
applying patches.

On Wed, Nov 6, 2013 at 7:38 AM, Eugene Krasnikov <k.eugene.e@gmail.com> wrote:
> Looks good to me, thanx!
>
> On Tue, Nov 5, 2013 at 8:21 PM, Dan Carpenter <dan.carpenter@oracle.com> wrote:
>> There are several places which are missing unlocks.
>>
>> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>>
>> diff --git a/drivers/net/wireless/ath/wcn36xx/smd.c b/drivers/net/wireless/ath/wcn36xx/smd.c
>> index f8c3a10..de9eb2c 100644
>> --- a/drivers/net/wireless/ath/wcn36xx/smd.c
>> +++ b/drivers/net/wireless/ath/wcn36xx/smd.c
>> @@ -1286,7 +1286,8 @@ int wcn36xx_smd_send_beacon(struct wcn36xx *wcn, struct ieee80211_vif *vif,
>>         } else {
>>                 wcn36xx_err("Beacon is to big: beacon size=%d\n",
>>                               msg_body.beacon_length);
>> -               return -ENOMEM;
>> +               ret = -ENOMEM;
>> +               goto out;
>>         }
>>         memcpy(msg_body.bssid, vif->addr, ETH_ALEN);
>>
>> @@ -1327,7 +1328,8 @@ int wcn36xx_smd_update_proberesp_tmpl(struct wcn36xx *wcn,
>>         if (skb->len > BEACON_TEMPLATE_SIZE) {
>>                 wcn36xx_warn("probe response template is too big: %d\n",
>>                              skb->len);
>> -               return -E2BIG;
>> +               ret = -E2BIG;
>> +               goto out;
>>         }
>>
>>         msg.probe_resp_template_len = skb->len;
>> @@ -1606,7 +1608,8 @@ int wcn36xx_smd_keep_alive_req(struct wcn36xx *wcn,
>>                 /* TODO: it also support ARP response type */
>>         } else {
>>                 wcn36xx_warn("unknow keep alive packet type %d\n", packet_type);
>> -               return -EINVAL;
>> +               ret = -EINVAL;
>> +               goto out;
>>         }
>>
>>         PREPARE_HAL_BUF(wcn->hal_buf, msg_body);
>
>
>
> --
> Best regards,
> Eugene



-- 
Best regards,
Eugene

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2013-11-06  7:40 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-11-05 20:21 [patch] wcn36xx: missing unlocks on error paths Dan Carpenter
2013-11-06  7:38 ` Eugene Krasnikov
2013-11-06  7:40   ` Eugene Krasnikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox