lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Date:	Fri, 3 Jun 2011 23:08:36 +0100
From:	Alan Cox <alan@...rguk.ukuu.org.uk>
To:	Russ Gorby <russ.gorby@...el.com>
Cc:	Greg Kroah-Hartman <gregkh@...e.de>, linux-kernel@...r.kernel.org,
	suhail.ahmed@...el.com
Subject: Re: [PATCH 3/5] tty: n_gsm: Added refcount usage to gsm_mux and
 gsm_dlci structs

> To avoid this, gsm_mux and dlcis now have a reference counter
> ldisc open takes a reference on the mux and all the dlcis
> gsmtty_open takes a reference on the mux, dlci0 and its specific
> dlci. Dropping the last reference initiates the actual free.

Definitely the right direction. Only comment really is style related

We usualyl define

struct foo *foo_get(struct foo *)
void foo_put(struct foo *)

helpers/inlines just make it clearer and keep the knowledge of the
function pointer etc in one place

Also when you take a reference this lets you write the more natural
reading

	bar->foo = foo_get(foo);


Alan
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ