From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754493Ab0IJPVQ (ORCPT ); Fri, 10 Sep 2010 11:21:16 -0400 Received: from iolanthe.rowland.org ([192.131.102.54]:40545 "HELO iolanthe.rowland.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with SMTP id S1751325Ab0IJPVP (ORCPT ); Fri, 10 Sep 2010 11:21:15 -0400 Date: Fri, 10 Sep 2010 11:21:13 -0400 (EDT) From: Alan Stern X-X-Sender: stern@iolanthe.rowland.org To: "Rafael J. Wysocki" cc: Arve =?iso-8859-1?q?Hj=F8nnev=E5g?= , Linux-pm mailing list , LKML Subject: Re: [RFC][PATCH] PM / Wakeup: Introduce wakeup source objects and event statistics (was: Re: Wakeup-events implementation) In-Reply-To: <201009080151.43047.rjw@sisk.pl> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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