Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751843AbcL1NNY (ORCPT ); Wed, 28 Dec 2016 08:13:24 -0500 Received: from mail-qt0-f171.google.com ([209.85.216.171]:35735 "EHLO mail-qt0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751671AbcL1NNX (ORCPT ); Wed, 28 Dec 2016 08:13:23 -0500 MIME-Version: 1.0 In-Reply-To: <1482233300-20078-3-git-send-email-bgolaszewski@baylibre.com> References: <1482233300-20078-1-git-send-email-bgolaszewski@baylibre.com> <1482233300-20078-3-git-send-email-bgolaszewski@baylibre.com> From: Linus Walleij Date: Wed, 28 Dec 2016 14:13:16 +0100 Message-ID: Subject: Re: [PATCH 2/3] gpio: mockup: dynamically allocate memory for chip name To: Bartosz Golaszewski Cc: Bamvor Jian Zhang , Alexandre Courbot , "linux-gpio@vger.kernel.org" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 454 Lines: 15 On Tue, Dec 20, 2016 at 12:28 PM, Bartosz Golaszewski wrote: > Currently the chip name buffer is allocated on the stack and the > address of the buffer is passed to the gpio framework. It's invalid > after probe() returns, so the sysfs label attribute displays garbage. > > Use devm_kasprintf() for each string instead. > > Signed-off-by: Bartosz Golaszewski Patch applied. Yours, Linus Walleij