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] [thread-next>] [day] [month] [year] [list]
Date:	Fri, 10 Sep 2010 11:21:13 -0400 (EDT)
From:	Alan Stern <stern@...land.harvard.edu>
To:	"Rafael J. Wysocki" <rjw@...k.pl>
cc:	Arve Hjønnevåg <arve@...roid.com>,
	Linux-pm mailing list <linux-pm@...ts.linux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [RFC][PATCH] PM / Wakeup: Introduce wakeup source objects and
 event statistics (was: Re: Wakeup-events implementation)

On Wed, 8 Sep 2010, Rafael J. Wysocki wrote:

> +struct wakeup_source *wakeup_source_create(const char *name)
> +{
> +	struct wakeup_source *ws;
> +
> +	ws = kzalloc(sizeof(*ws), GFP_KERNEL);
> +	if (!ws)
> +		return NULL;
> +
> +	if (name) {
> +		int len = strlen(name);
> +		char *s = kzalloc(len + 1, GFP_KERNEL);
> +		if (s) {
> +			strncpy(s, name, len);
> +			ws->name = s;
> +		}
> +	}
> +
> +	return ws;
> +}

Forget what I wrote earlier; it was stupid.  Just use kstrdup.

Alan Stern

--
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