lkml.org 
[lkml]   [2017]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
SubjectRe: [PATCH net v2] net: x25: fix one potential use-after-free issue
From
From: linzhang <xiaolou4617@gmail.com>
Date: Tue, 16 May 2017 11:52:54 +0800

> return rc;
> -out_dev:
> +out_proc:
> + x25_unregister_sysctl();
> +out_sysctl:
> unregister_netdevice_notifier(&x25_dev_notifier);
> -out_sock:
> +out_dev:
> + dev_remove_pack(&x25_packet_type);
> sock_unregister(AF_X25);
> -out_proto:
> +out_sock:
> proto_unregister(&x25_proto);
> goto out;
> }

Please do not name the labels this way, retain the current convention.
And that is the label names what resources get released not the
resource that we failed to acquire.

So the first label, should be "out_sysctl:" because that is what we
are releasing.

\
 
 \ /
  Last update: 2017-05-16 19:41    [W:2.980 / U:0.092 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site