aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorDan Murphy2013-04-12 12:55:33 -0500
committerDan Murphy2013-04-12 12:55:33 -0500
commit57070be1bdfd32a577c416b6429236e7a6eae1e7 (patch)
tree37d1b3cda966d833ec88edf23916d7a82591a02d /net
parentb159d2746a2abf7ee22ed0d60c971c3d02dd92f3 (diff)
parent531ec28f9f26f78797124b9efcf2138b89794a1e (diff)
downloadkernel-video-57070be1bdfd32a577c416b6429236e7a6eae1e7.tar.gz
kernel-video-57070be1bdfd32a577c416b6429236e7a6eae1e7.tar.xz
kernel-video-57070be1bdfd32a577c416b6429236e7a6eae1e7.zip
Merge branch 'linux-3.8.y' of http://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable into ti-linux-3.8.y
* 'linux-3.8.y' of http://git.kernel.org/pub/scm/linux/kernel/git/stable/linux-stable: (66 commits) Linux 3.8.7 Revert "tty/8250_pnp: serial port detection regression since v3.7" rt2x00: rt2x00pci_regbusy_read() - only print register access failure once mwifiex: complete last internal scan can: gw: use kmem_cache_free() instead of kfree() NFSv4: Doh! Typo in the fix to nfs41_walk_client_list vfio-pci: Fix possible integer overflow r8169: fix auto speed down issue drm/i915: add quirk to invert brightness on Packard Bell NCL20 drm/i915: add quirk to invert brightness on eMachines e725 drm/i915: add quirk to invert brightness on eMachines G725 ARM: EXYNOS: Fix crash on soft reset on EXYNOS5440 cpufreq: exynos: Get booting freq value in exynos_cpufreq_init msi-wmi: Fix memory leak thermal: return an error on failure to register thermal class Revert "PCI/ACPI: Request _OSC control before scanning PCI root bus" x86: Fix rebuild with EFI_STUB enabled drm/i915: Fix build failure NFSv4/4.1: Fix bugs in nfs4[01]_walk_client_list NFSv4: Fix a memory leak in nfs4_discover_server_trunking ... Signed-off-by: Dan Murphy <dmurphy@ti.com>
Diffstat (limited to 'net')
-rw-r--r--net/can/gw.c6
-rw-r--r--net/mac80211/cfg.c6
-rw-r--r--net/mac80211/ieee80211_i.h3
-rw-r--r--net/mac80211/offchannel.c23
-rw-r--r--net/sunrpc/clnt.c4
5 files changed, 27 insertions, 15 deletions
diff --git a/net/can/gw.c b/net/can/gw.c
index 574dda78eb0..28e7bdc9df8 100644
--- a/net/can/gw.c
+++ b/net/can/gw.c
@@ -436,7 +436,7 @@ static int cgw_notifier(struct notifier_block *nb,
436 if (gwj->src.dev == dev || gwj->dst.dev == dev) { 436 if (gwj->src.dev == dev || gwj->dst.dev == dev) {
437 hlist_del(&gwj->list); 437 hlist_del(&gwj->list);
438 cgw_unregister_filter(gwj); 438 cgw_unregister_filter(gwj);
439 kfree(gwj); 439 kmem_cache_free(cgw_cache, gwj);
440 } 440 }
441 } 441 }
442 } 442 }
@@ -829,7 +829,7 @@ static void cgw_remove_all_jobs(void)
829 hlist_for_each_entry_safe(gwj, n, nx, &cgw_list, list) { 829 hlist_for_each_entry_safe(gwj, n, nx, &cgw_list, list) {
830 hlist_del(&gwj->list); 830 hlist_del(&gwj->list);
831 cgw_unregister_filter(gwj); 831 cgw_unregister_filter(gwj);
832 kfree(gwj); 832 kmem_cache_free(cgw_cache, gwj);
833 } 833 }
834} 834}
835 835
@@ -885,7 +885,7 @@ static int cgw_remove_job(struct sk_buff *skb, struct nlmsghdr *nlh, void *arg)
885 885
886 hlist_del(&gwj->list); 886 hlist_del(&gwj->list);
887 cgw_unregister_filter(gwj); 887 cgw_unregister_filter(gwj);
888 kfree(gwj); 888 kmem_cache_free(cgw_cache, gwj);
889 err = 0; 889 err = 0;
890 break; 890 break;
891 } 891 }
diff --git a/net/mac80211/cfg.c b/net/mac80211/cfg.c
index 15d886c639e..30fb87f4275 100644
--- a/net/mac80211/cfg.c
+++ b/net/mac80211/cfg.c
@@ -2554,7 +2554,7 @@ static int ieee80211_cancel_roc(struct ieee80211_local *local,
2554 list_del(&dep->list); 2554 list_del(&dep->list);
2555 mutex_unlock(&local->mtx); 2555 mutex_unlock(&local->mtx);
2556 2556
2557 ieee80211_roc_notify_destroy(dep); 2557 ieee80211_roc_notify_destroy(dep, true);
2558 return 0; 2558 return 0;
2559 } 2559 }
2560 2560
@@ -2594,7 +2594,7 @@ static int ieee80211_cancel_roc(struct ieee80211_local *local,
2594 ieee80211_start_next_roc(local); 2594 ieee80211_start_next_roc(local);
2595 mutex_unlock(&local->mtx); 2595 mutex_unlock(&local->mtx);
2596 2596
2597 ieee80211_roc_notify_destroy(found); 2597 ieee80211_roc_notify_destroy(found, true);
2598 } else { 2598 } else {
2599 /* work may be pending so use it all the time */ 2599 /* work may be pending so use it all the time */
2600 found->abort = true; 2600 found->abort = true;
@@ -2604,6 +2604,8 @@ static int ieee80211_cancel_roc(struct ieee80211_local *local,
2604 2604
2605 /* work will clean up etc */ 2605 /* work will clean up etc */
2606 flush_delayed_work(&found->work); 2606 flush_delayed_work(&found->work);
2607 WARN_ON(!found->to_be_freed);
2608 kfree(found);
2607 } 2609 }
2608 2610
2609 return 0; 2611 return 0;
diff --git a/net/mac80211/ieee80211_i.h b/net/mac80211/ieee80211_i.h
index 5fba867d9e2..ec14647b63f 100644
--- a/net/mac80211/ieee80211_i.h
+++ b/net/mac80211/ieee80211_i.h
@@ -346,6 +346,7 @@ struct ieee80211_roc_work {
346 struct ieee80211_channel *chan; 346 struct ieee80211_channel *chan;
347 347
348 bool started, abort, hw_begun, notified; 348 bool started, abort, hw_begun, notified;
349 bool to_be_freed;
349 350
350 unsigned long hw_start_time; 351 unsigned long hw_start_time;
351 352
@@ -1372,7 +1373,7 @@ void ieee80211_offchannel_return(struct ieee80211_local *local);
1372void ieee80211_roc_setup(struct ieee80211_local *local); 1373void ieee80211_roc_setup(struct ieee80211_local *local);
1373void ieee80211_start_next_roc(struct ieee80211_local *local); 1374void ieee80211_start_next_roc(struct ieee80211_local *local);
1374void ieee80211_roc_purge(struct ieee80211_sub_if_data *sdata); 1375void ieee80211_roc_purge(struct ieee80211_sub_if_data *sdata);
1375void ieee80211_roc_notify_destroy(struct ieee80211_roc_work *roc); 1376void ieee80211_roc_notify_destroy(struct ieee80211_roc_work *roc, bool free);
1376void ieee80211_sw_roc_work(struct work_struct *work); 1377void ieee80211_sw_roc_work(struct work_struct *work);
1377void ieee80211_handle_roc_started(struct ieee80211_roc_work *roc); 1378void ieee80211_handle_roc_started(struct ieee80211_roc_work *roc);
1378 1379
diff --git a/net/mac80211/offchannel.c b/net/mac80211/offchannel.c
index 82baf5b6ecf..057f3ccd707 100644
--- a/net/mac80211/offchannel.c
+++ b/net/mac80211/offchannel.c
@@ -302,10 +302,13 @@ void ieee80211_start_next_roc(struct ieee80211_local *local)
302 } 302 }
303} 303}
304 304
305void ieee80211_roc_notify_destroy(struct ieee80211_roc_work *roc) 305void ieee80211_roc_notify_destroy(struct ieee80211_roc_work *roc, bool free)
306{ 306{
307 struct ieee80211_roc_work *dep, *tmp; 307 struct ieee80211_roc_work *dep, *tmp;
308 308
309 if (WARN_ON(roc->to_be_freed))
310 return;
311
309 /* was never transmitted */ 312 /* was never transmitted */
310 if (roc->frame) { 313 if (roc->frame) {
311 cfg80211_mgmt_tx_status(&roc->sdata->wdev, 314 cfg80211_mgmt_tx_status(&roc->sdata->wdev,
@@ -321,9 +324,12 @@ void ieee80211_roc_notify_destroy(struct ieee80211_roc_work *roc)
321 GFP_KERNEL); 324 GFP_KERNEL);
322 325
323 list_for_each_entry_safe(dep, tmp, &roc->dependents, list) 326 list_for_each_entry_safe(dep, tmp, &roc->dependents, list)
324 ieee80211_roc_notify_destroy(dep); 327 ieee80211_roc_notify_destroy(dep, true);
325 328
326 kfree(roc); 329 if (free)
330 kfree(roc);
331 else
332 roc->to_be_freed = true;
327} 333}
328 334
329void ieee80211_sw_roc_work(struct work_struct *work) 335void ieee80211_sw_roc_work(struct work_struct *work)
@@ -336,6 +342,9 @@ void ieee80211_sw_roc_work(struct work_struct *work)
336 342
337 mutex_lock(&local->mtx); 343 mutex_lock(&local->mtx);
338 344
345 if (roc->to_be_freed)
346 goto out_unlock;
347
339 if (roc->abort) 348 if (roc->abort)
340 goto finish; 349 goto finish;
341 350
@@ -375,7 +384,7 @@ void ieee80211_sw_roc_work(struct work_struct *work)
375 finish: 384 finish:
376 list_del(&roc->list); 385 list_del(&roc->list);
377 started = roc->started; 386 started = roc->started;
378 ieee80211_roc_notify_destroy(roc); 387 ieee80211_roc_notify_destroy(roc, !roc->abort);
379 388
380 if (started) { 389 if (started) {
381 drv_flush(local, false); 390 drv_flush(local, false);
@@ -415,7 +424,7 @@ static void ieee80211_hw_roc_done(struct work_struct *work)
415 424
416 list_del(&roc->list); 425 list_del(&roc->list);
417 426
418 ieee80211_roc_notify_destroy(roc); 427 ieee80211_roc_notify_destroy(roc, true);
419 428
420 /* if there's another roc, start it now */ 429 /* if there's another roc, start it now */
421 ieee80211_start_next_roc(local); 430 ieee80211_start_next_roc(local);
@@ -465,12 +474,14 @@ void ieee80211_roc_purge(struct ieee80211_sub_if_data *sdata)
465 list_for_each_entry_safe(roc, tmp, &tmp_list, list) { 474 list_for_each_entry_safe(roc, tmp, &tmp_list, list) {
466 if (local->ops->remain_on_channel) { 475 if (local->ops->remain_on_channel) {
467 list_del(&roc->list); 476 list_del(&roc->list);
468 ieee80211_roc_notify_destroy(roc); 477 ieee80211_roc_notify_destroy(roc, true);
469 } else { 478 } else {
470 ieee80211_queue_delayed_work(&local->hw, &roc->work, 0); 479 ieee80211_queue_delayed_work(&local->hw, &roc->work, 0);
471 480
472 /* work will clean up etc */ 481 /* work will clean up etc */
473 flush_delayed_work(&roc->work); 482 flush_delayed_work(&roc->work);
483 WARN_ON(!roc->to_be_freed);
484 kfree(roc);
474 } 485 }
475 } 486 }
476 487
diff --git a/net/sunrpc/clnt.c b/net/sunrpc/clnt.c
index 507b5e84fbd..716aa41aa4d 100644
--- a/net/sunrpc/clnt.c
+++ b/net/sunrpc/clnt.c
@@ -511,7 +511,7 @@ static struct rpc_clnt *__rpc_clone_client(struct rpc_create_args *args,
511 new = rpc_new_client(args, xprt); 511 new = rpc_new_client(args, xprt);
512 if (IS_ERR(new)) { 512 if (IS_ERR(new)) {
513 err = PTR_ERR(new); 513 err = PTR_ERR(new);
514 goto out_put; 514 goto out_err;
515 } 515 }
516 516
517 atomic_inc(&clnt->cl_count); 517 atomic_inc(&clnt->cl_count);
@@ -524,8 +524,6 @@ static struct rpc_clnt *__rpc_clone_client(struct rpc_create_args *args,
524 new->cl_chatty = clnt->cl_chatty; 524 new->cl_chatty = clnt->cl_chatty;
525 return new; 525 return new;
526 526
527out_put:
528 xprt_put(xprt);
529out_err: 527out_err:
530 dprintk("RPC: %s: returned error %d\n", __func__, err); 528 dprintk("RPC: %s: returned error %d\n", __func__, err);
531 return ERR_PTR(err); 529 return ERR_PTR(err);