source code of Linux source code
Go to file
Mirsad Goran Todorovac 7dae593cd2 test_firmware: return ENOMEM instead of ENOSPC on failed memory allocation
In a couple of situations like

	name = kstrndup(buf, count, GFP_KERNEL);
	if (!name)
		return -ENOSPC;

the error is not actually "No space left on device", but "Out of memory".

It is semantically correct to return -ENOMEM in all failed kstrndup()
and kzalloc() cases in this driver, as it is not a problem with disk
space, but with kernel memory allocator failing allocation.

The semantically correct should be:

        name = kstrndup(buf, count, GFP_KERNEL);
        if (!name)
                return -ENOMEM;

Cc: Dan Carpenter <error27@gmail.com>
Cc: Takashi Iwai <tiwai@suse.de>
Cc: Kees Cook <keescook@chromium.org>
Cc: "Luis R. Rodriguez" <mcgrof@ruslug.rutgers.edu>
Cc: Scott Branden <sbranden@broadcom.com>
Cc: Hans de Goede <hdegoede@redhat.com>
Cc: Brian Norris <briannorris@chromium.org>
Fixes: c92316bf8e ("test_firmware: add batched firmware tests")
Fixes: 0a8adf5847 ("test: add firmware_class loader test")
Fixes: 548193cba2 ("test_firmware: add support for firmware_request_platform")
Fixes: eb910947c8 ("test: firmware_class: add asynchronous request trigger")
Fixes: 061132d2b9 ("test_firmware: add test custom fallback trigger")
Fixes: 7feebfa487 ("test_firmware: add support for request_firmware_into_buf")
Signed-off-by: Mirsad Goran Todorovac <mirsad.todorovac@alu.unizg.hr>
Reviewed-by: Dan Carpenter <dan.carpenter@linaro.org>
Message-ID: <20230606070808.9300-1-mirsad.todorovac@alu.unizg.hr>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2023-06-15 13:42:18 +02:00
Documentation dt-bindings: nvmem: imx-ocotp: drop unneeded address/size-cells and children 2023-06-15 13:42:18 +02:00
LICENSES
arch ARM: 2023-06-04 07:16:53 -04:00
block
certs
crypto
drivers mux: adg792a: Switch back to use i2c_driver's .probe() 2023-06-15 13:42:18 +02:00
fs Fix an ext4 regression which landed during the 6.4 merge window. 2023-06-02 17:25:22 -04:00
include misc: tps6594-pfsm: Add driver for TI TPS6594 PFSM 2023-06-15 13:41:53 +02:00
init
io_uring
ipc
kernel Probes fixes for 6.4-rc4: 2023-06-03 08:23:16 -04:00
lib test_firmware: return ENOMEM instead of ENOSPC on failed memory allocation 2023-06-15 13:42:18 +02:00
mm
net
rust
samples samples: Add userspace example for TI TPS6594 PFSM 2023-06-15 13:41:53 +02:00
scripts
security
sound
tools First set of Counter updates for the 6.5 cycle 2023-06-15 13:07:59 +02:00
usr
virt
.clang-format
.cocciconfig
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
.rustfmt.toml
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS First set of Counter updates for the 6.5 cycle 2023-06-15 13:07:59 +02:00
Makefile Linux 6.4-rc5 2023-06-04 14:04:27 -04:00
README

README

Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.