Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751591AbbLUTGP (ORCPT ); Mon, 21 Dec 2015 14:06:15 -0500 Received: from mx2.suse.de ([195.135.220.15]:50995 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751264AbbLUTGN (ORCPT ); Mon, 21 Dec 2015 14:06:13 -0500 Date: Mon, 21 Dec 2015 20:06:10 +0100 From: "Luis R. Rodriguez" To: Brian Norris Cc: Shuah Khan , Greg Kroah-Hartman , Ming Lei , Kees Cook , linux-kernel@vger.kernel.org, linux-api@vger.kernel.org Subject: Re: [PATCH v2 4/5] firmware: actually return NULL on failed request_firmware_nowait() Message-ID: <20151221190609.GP20409@wotan.suse.de> References: <1449701429-121423-1-git-send-email-computersforpeace@gmail.com> <1449701429-121423-4-git-send-email-computersforpeace@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1449701429-121423-4-git-send-email-computersforpeace@gmail.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1369 Lines: 32 On Wed, Dec 09, 2015 at 02:50:28PM -0800, Brian Norris wrote: > The kerneldoc for request_firmware_nowait() says that it may call the > provided cont() callback with @fw == NULL, if the firmware request > fails. However, this is not the case when called with an empty string > (""). This case is short-circuited by the 'name[0] == '\0'' check > introduced in commit 471b095dfe0d ("firmware_class: make sure fw requests > contain a name"), so _request_firmware() never gets to set the fw to > NULL. > > Noticed while using the new 'trigger_async_request' testing hook: <-- snip --> > > # printf '\x00' > /sys/devices/virtual/misc/test_firmware/trigger_async_request > [ 32.126322] test_firmware: loading '' > [ 32.129995] test_firmware: failed to async load firmware > -bash: printf: write error: No such device > > Fixes: 471b095dfe0d ("firmware_class: make sure fw requests contain a name") > Signed-off-by: Brian Norris > Acked-by: Ming Lei > Acked-by: Kees Cook Acked-by: Luis R. Rodriguez Luis -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/