From c228e3f5b8fe7aadbee686684beec95d8450286a Mon Sep 17 00:00:00 2001 From: Amitkumar Karwar Date: Wed, 27 Apr 2011 19:13:13 -0700 Subject: [PATCH] --- yaml --- r: 247231 b: refs/heads/master c: 030fe7974f48bd86bb706ec05188ebab0cb7af80 h: refs/heads/master i: 247229: 0c5374bbde1f53d7b02a1f8464e54c99503799f0 247227: 5dc55764e8512cdfccd912f289645beca9160b89 247223: 20782951967514d86932c8e1596de46284c62c4b 247215: db4b9a77db19799cd5bd3ba674be7cfcfc8a190a 247199: e4025e5ca173380554fdaea95fefabc0839a547d 247167: cd7fa911bfd68c4a8cc90a2421907e0b06f2e8ae v: v3 --- [refs] | 2 +- trunk/drivers/net/wireless/mwifiex/scan.c | 28 ++++++++++------------- 2 files changed, 13 insertions(+), 17 deletions(-) diff --git a/[refs] b/[refs] index 96254936f1c6..d03140104335 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a46b7b5c13b9ecfe2b4e045e06aaec644dcf55d8 +refs/heads/master: 030fe7974f48bd86bb706ec05188ebab0cb7af80 diff --git a/trunk/drivers/net/wireless/mwifiex/scan.c b/trunk/drivers/net/wireless/mwifiex/scan.c index be708ad8c44d..31a529578805 100644 --- a/trunk/drivers/net/wireless/mwifiex/scan.c +++ b/trunk/drivers/net/wireless/mwifiex/scan.c @@ -2990,32 +2990,28 @@ mwifiex_save_curr_bcn(struct mwifiex_private *priv) struct mwifiex_bssdescriptor *curr_bss = &priv->curr_bss_params.bss_descriptor; - /* save the beacon buffer if it is not saved or updated */ - if ((priv->curr_bcn_buf == NULL) || - (priv->curr_bcn_size != curr_bss->beacon_buf_size) || - (memcmp(priv->curr_bcn_buf, curr_bss->beacon_buf, - curr_bss->beacon_buf_size))) { - - kfree(priv->curr_bcn_buf); - priv->curr_bcn_buf = NULL; + if (!curr_bss->beacon_buf_size) + return; + /* allocate beacon buffer at 1st time; or if it's size has changed */ + if (!priv->curr_bcn_buf || + priv->curr_bcn_size != curr_bss->beacon_buf_size) { priv->curr_bcn_size = curr_bss->beacon_buf_size; - if (!priv->curr_bcn_size) - return; + kfree(priv->curr_bcn_buf); priv->curr_bcn_buf = kzalloc(curr_bss->beacon_buf_size, GFP_KERNEL); if (!priv->curr_bcn_buf) { dev_err(priv->adapter->dev, "failed to alloc curr_bcn_buf\n"); - } else { - memcpy(priv->curr_bcn_buf, curr_bss->beacon_buf, - curr_bss->beacon_buf_size); - dev_dbg(priv->adapter->dev, - "info: current beacon saved %d\n", - priv->curr_bcn_size); + return; } } + + memcpy(priv->curr_bcn_buf, curr_bss->beacon_buf, + curr_bss->beacon_buf_size); + dev_dbg(priv->adapter->dev, "info: current beacon saved %d\n", + priv->curr_bcn_size); } /*