On Wed, Jan 08, 2025 at 10:03:08AM -0700, Simon Glass wrote:
> Hi Dan,
>
> On Wed, 8 Jan 2025 at 05:37, Dan Carpenter wrote:
> >
> > On Wed, Jan 08, 2025 at 12:21:18PM +0100, Heinrich Schuchardt wrote:
> > > Am 8. Januar 2025 12:11:05 MEZ schrieb Yixun Lan :
> &
(void)
> >> +{
> >> + u32 cs0_size = map_format_size(readl((void *)DDR_BASE + 0x200));
> >> + u32 cs1_size = map_format_size(readl((void *)DDR_BASE + 0x208));
> >> + u32 ddr_size = cs0_size + cs1_size;
> >> +
> >> + return ddr_size;
> >> +}
> >> +
> >> int dram_init(void)
> >> {
> >>gd->ram_base = CFG_SYS_SDRAM_BASE;
> >> - /* TODO get ram size from ddr controller */
> >> - gd->ram_size = SZ_4G;
> >> + gd->ram_size = (u64)ddr_get_density() * SZ_1M;
>
> This is C and not C++. We don't need a cast to assign here.
>
I assumed the cast was to prevent an integer overflow. The commit
message mentions 8GB? I agree with Yixun Lan that the type of
ddr_get_density() should be fixed and probably SZ_1M should be declared
as unsigned long as well.
regards,
dan carpenter
Thanks, Andrew!
regards,
dan carpenter
usually
> read files into huge static memory areas.
>
> Signed-off-by: Alex Shumsky
Could you add a Fixes tag?
regards,
dan carpenter
but do we ever free the original boot_dev?
> + goto found;
> + } else {
> + efi_free_pool(boot_dev);
> + boot_dev = NULL;
> + }
Better to delete indenting where you can:
full_path =
get_esp_from_boot_option_file_path(boot_dev);
if (full_path) {
boot_dev = full_path;
goto found;
}
efi_free_pool(boot_dev);
boot_dev = NULL;
regards,
dan carpenter
all strlen() on it in either hsearch_r() or
env_get_from_linear().
All the other functions had a mac_addr[] issue as well.
Btw, this kind of bug is a good candidate for a static checker warning.
I can create a Smatch check for this. It would probably be easier in
Coccinelle even, but I
those memory leaks would need to be
fixed. For the style issues run ./scripts/checkpatch.pl on your patch.
regards,
dan carpenter
const struct spi_mem_op *op)
> {
> @@ -353,6 +649,9 @@ static int cadence_spi_mem_exec_op(struct spi_slave *spi,
> break;
> }
>
> + if (op->cmd.dtr)
> + err = cadence_spi_setup_ddrmode(spi, op);
> +
> return err;
I think there should be another if (err) return err after the end of the
switch statement.
> }
>
regards,
dan carpenter
g to see if
people abandon this style guideline.
regards,
dan carpenter
> Fixes: 163c5f60ebb4 ("fdt_support: add fdt_copy_fixed_partitions function")
>
> Signed-off-by: Patrice Chotard
> ---
On Wed, Mar 06, 2024 at 09:50:06AM +0100, Heinrich Schuchardt wrote:
> On 3/5/24 16:16, Dan Carpenter wrote:
> > Select CONFIG_64BIT so that we pass the -m64 option (instead of -m32) to
> > static analysis tools.
> >
> > Signed-off-by: Dan Carpenter
> > -
ating the three bears' food... This is
invalid. This is low. This is high. This poridge is just right.
regards,
dan carpenter
ot the implementation ID.
>
> * Show the correct number
> * Use a hexadecimal output format
> * Add a missing line feed
>
> Signed-off-by: Heinrich Schuchardt
Reviewed-by: Dan Carpenter
Fixes: 89a86dcf6191 ("cmd: sbi: show SBI implementation version")
regards,
dan carpenter
.end = 0x3fc4f,
> + };
> + struct fdt_memory gap2 = {
> + .start = 0x3fff0,
> + .end = 0x3,
> + };
> + unsigned long flags = FDTDEC_RESERVED_MEMORY_NO_MAP;
> + unsigned int ret;
"ret" should be int. This doesn't affect r
Select CONFIG_64BIT so that we pass the -m64 option (instead of -m32) to
static analysis tools.
Signed-off-by: Dan Carpenter
---
arch/x86/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/x86/Kconfig b/arch/x86/Kconfig
index 99e59d94c606..fb7772936cd5 100644
--- a/arch/x86
Select CONFIG_64BIT so that we pass the -m64 option (instead of -m32) to
static analysis tools.
Signed-off-by: Dan Carpenter
---
arch/sandbox/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/sandbox/Kconfig b/arch/sandbox/Kconfig
index 0ce77de2fcb4..c431da60e8c4 100644
--- a
s the correct machine size
1053 CHECKFLAGS += $(if $(CONFIG_64BIT),-m64,-m32)
Dan Carpenter (2):
sandbox: select CONFIG_64BIT for SANDBOX64
sandbox: select CONFIG_64BIT for X86_64
arch/sandbox/Kconfig | 1 +
arch/x86/Kconfig | 1 +
2 files changed, 2 insertions(+)
--
2.43.0
n v2:
> - Don't drop the initialisation of ret (thanks Dan!).
> - Link to v1:
> https://lore.kernel.org/u-boot/20240219183519.2183405-1-caleb.conno...@linaro.org/
>
> Cc: Dan Carpenter
Awesome. Thanks!
Reviewed-by: Dan Carpenter
regards,
dan carpenter
On Mon, Mar 04, 2024 at 02:44:12PM +0100, Heinrich Schuchardt wrote:
> On 04.03.24 08:04, Dan Carpenter wrote:
> > In the Makefile there is a line that says this:
> >
> > # the checker needs the correct machine size
> > CHECKFLAGS += $(if $(CONFIG_64B
Anyway, looks good! I already gave my reviewed by. Thanks for your
work on this.
regards,
dan carpenter
In the Makefile there is a line that says this:
# the checker needs the correct machine size
CHECKFLAGS += $(if $(CONFIG_64BIT),-m64,-m32)
Set CONFIG_64BIT for ARM64 so that we pass -m64 to the static checkers
instead of -m32.
Signed-off-by: Dan Carpenter
---
v2: split the patch into
These configs are used in multiple places so put them in a shared
Kconfig file.
Signed-off-by: Dan Carpenter
---
v2: split the patch into two patches
arch/Kconfig | 6 ++
arch/mips/Kconfig | 6 --
arch/riscv/Kconfig | 6 --
3 files changed, 6 insertions(+), 12 deletions
The makefiles currently pass -m32 to Smatch static checker when I'm
building on arm64. Also the arch is set to "arm" and Smatch thinks
"arm" is 32 bits and "arm64" is 64 bits. With this patchset we pass
-m64 and Smatch works correctly.
Changes since v1:
Break
On Sun, Mar 03, 2024 at 02:14:43AM +, Jacky Chou wrote:
> Hi Dan Carpenter,
>
> I have verified it on the little-endian platform, such as ASPEED AST2600.
Awesome. Thanks for this.
> I think put_unaligned_be32() and htonl() functions have no effect on
> big-endian platfo
ouldn't
cause a crash...
Fixes: 3dd0f8cccd6d ("mtd: nand: Remove hardcoded base address of nand")
regards,
dan carpenter
eturn NULL so probably we should add a NULL check here too.
if (!str || strcmp(str, "hw") != 0) {
regards,
dan carpenter
et)
goto unbind_rstdev;
return 0;
unbind_rstdev:
device_unbind(rstdev);
unbind_clkdev:
device_unbind(clkdev);
return ret;
> +
> return ret;
> }
>
regards,
dan carpenter
updates could be
> brought in with greater ease.
Yeah. For this kind of thing you wouldn't want to make a bunch of
checkpatch changes. They sometimes pull crypto and compression
libraries into the Linux kernel pretty much unmodified as well for the
same reason.
Igor's proposal abou
> Signed-off-by: Sébastien Szymanski
Huh. This is the commit that did that upstream.
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/commit/?id=d9aa4d4fca67823838fe9861456201430c545e69
It's interesting how the timings in linux were always slightly different
from in u-boot.
regards,
dan carpenter
bank_size, count);
>
> - return 0;
> + return ret;
Please leave this as return 0;
regards,
dan carpenter
et)
^^^^
This if statement seems to be reversed.
regards,
dan carpenter
> + return ret;
> + return pl01x_serial_setbrg(dev, gd->baudrate);
> + } else {
> return 0;
> + }
> }
;if (value > reg_base)". Or something like this:
val = val >> 1;
if (val < 0 || val > mask)
return -EINVAL;
if (val <= reg_base)
return base;
if (val >= reg_max)
return max;
return base + (step * (val - reg_base));
regards,
dan carpenter
g config
> 64BIT entries to arch/Kconfig and then select it for ARM64? Thanks.
Sure. Even better.
regards,
dan carpenter
In the Makefile there is a line that says this:
# the checker needs the correct machine size
CHECKFLAGS += $(if $(CONFIG_64BIT),-m64,-m32)
So set CONFIG_64BIT so that we don't pass -m32 to the static checker.
Signed-off-by: Dan Carpenter
---
arch/arm/Kconfig | 4
1 file ch
ce to `_u_boot_list_2_bootdev_hunter_2_mmc_bootdev_hunter'
Fixes: 66e3dce78750 ("bootstd: Allow hunting for a bootdev by label")
Signed-off-by: Dan Carpenter
---
test/boot/bootstd_common.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/test/boot/bootstd_common.c b/test/boot/bo
ce to `_u_boot_list_2_driver_2_bootmeth_cros'
Fixes: d08db02d2d3d ("bootstd: Add a test for bootmeth_cros")
Signed-off-by: Dan Carpenter
---
test/boot/bootflow.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/test/boot/bootflow.c b/test/boot/bootflow.c
index fa54dde661c8..4845b7121c
s and I understand that you just wanted a
high level review but I kept getting distracted and lost and I couldn't
apply the patch so it was just really hard to figure out what was going
on. :(
regards,
dan carpenter
this is called from board_init_f_r(). The
array is empty except for the NULL sentinal at the end. We don't
enter the loop in that case.
regards,
dan carpenter
>
> - for (ptr = init_sequence; func = *ptr, !ret && func; ptr++) {
> + for (ptr = init_sequence; func = *pt
%d\n", __func__, ret);
> + return ret;
This should be something like:
return ret ?: -EINVAL;
Perhaps print the width and height in the error message as well.
regards,
dan carpenter
ot; at the end of udma_probe() to a
> "return 0", to explicitly indicate that probe was successful.
>
> Fixes: a8837cf43839 ("dma: ti: k3-udma: Query DMA channels allocated from
> Resource Manager")
> Signed-off-by: Siddharth Vadapalli
> ---
Thanks!
Reviewed-by: Dan Carpenter
regards,
dan carpenter
(ret <= 0)
> + return ret;
The code was like this originally, but setup_resources() can't actually
return zero so it would be nicer to say:
ret = setup_resources(ud);
if (ret < 0)
return ret;
regards,
dan carpenter
> +
> + ud->ch_count = ret;
>
On Tue, Feb 20, 2024 at 09:38:01AM +0100, Frieder Schrempf wrote:
> Hi Dan,
>
> On 20.02.24 06:56, Dan Carpenter wrote:
> > On Thu, Feb 15, 2024 at 02:35:20PM +0100, Frieder Schrempf wrote:
> >> +int board_mmc_getcd(struct mmc *mmc)
> >
> > This function is ne
; - if (ret < 0)
> - return ret;
> + /* If clock-names is unspecified, then the first clock is the core
> clock */
> + if (!ofnode_get_property(node, "clock-names", &n_clks)) {
> + if (!clk_set_rate(&prv->clks.clks[0], cl
(%d) than supported by the board\n"
There is a checkpatch warnings for this.
WARNING: Avoid line continuations in quoted strings
#1137: FILE: board/sielaff/imx6dl-sielaff/spl.c:96:
+ printf("Warning: you configured more USDHC controllers \
regards,
dan carpenter
FDT at 0x%08lx ...\n", fdt_addr);
if (image_setup_libfdt(&img, (void *)fdt_addr, 0, NULL)) {
printf("ERROR: Failed to process device tree\n");
return 1;
}
}
regards,
dan carpenter
he visible effects for the
user?
regards,
dan carpenter
lk are type unsigned char. If you take the
~ of an unsigned char it's going to be 0xffXX where XX are the
a variable bits. That's never going to be equal to xyz.cblk.
You could truncate it to char like this:
+ if ((unsigned char)~xyz.blk != xyz.cblk)
But then it works exactly the same as the original condition.
regards,
dan carpenter
mx8mp-phyboard-pollux: Add missing usdhc clocks
assignment
055e38c76388 arm64: dts: imx8mp-phyboard-pollux-rdk: Fix led sub-node names
regards,
dan carpenter
On Mon, Feb 05, 2024 at 04:02:28PM +0800, Jacky Chou wrote:
> There is no need to perform the endian twice here.
>
> Signed-off-by: Jacky Chou
Reviewed-by: Dan Carpenter
Fixes: f641a8ac93e0 ("phy: Add support for the NC-SI protocol")
How did this ever work? Was this a
. Is that
really intentional? Is this from reviewing documentation or something?
What documents? Or is it from testing?
regards,
dan carpenter
fixed-link");
> + if (fl_node != -FDT_ERR_NOTFOUND) {
Why not check for if (fl_node >= 0)? The fdt_subnode_offset() function
can return a variety of error codes.
regards,
dan carpenter
> + /* set phy_addr to invalid value for fixed link */
> + macb->p
he Linux
kernel's clk_get_rate() function returns zero and not error codes, btw.
regards,
dan carpenter
d it to be just
"size_per_copy" or maybe some kind of limit minus the offset...
> + buffer, flags);
> + if (ret)
> + return ret;
> + }
> +
> + return 0;
> +}
regards,
dan carpenter
enable(priv->base + USB30_SEC_GDSCR);
> + qcom_gate_clk_en(priv, GCC_USB3_SEC_PHY_AUX_CLK);
> +
> + qcom_gate_clk_en(priv, GCC_USB3_SEC_CLKREF_CLK);
> + qcom_gate_clk_en(priv, GCC_USB3_SEC_PHY_COM_AUX_CLK);
> + break;
> + }
regards,
dan carpenter
^^^
> + if (flags & GPIOD_PULL_UP)
> + return msm_gpio_set_value(dev, gpio, 1);
> + else if (flags & GPIOD_PULL_DOWN)
> + return msm_gpio_set_value(dev, gpio, 0);
These lines are unreachable code.
> + }
> +
> + return 0;
> +}
regards,
dan carpenter
On Wed, Jan 31, 2024 at 02:48:58PM +0300, Dan Carpenter wrote:
> Etienne should have been on the CC list. He's in
> ./scripts/get_maintainer.pl so I'm not sure what went wrong there...
> I've added him.
>
Hm... Etienne's @linaro.org address bounces. Apparently
c->invoke_fn)))
> + if (!smccc || !(smccc_trng_is_supported(smccc->invoke_fn)))
To me it seems a bit strange that dm_priv_to_rw() can return NULL...
Anyway, probably the Fixes tag should point to when the driver was
added.
Fixes: 53355bb86c25 ("drivers: rng: add smccc trng driver")
regards,
dan carpenter
1 break;
222
223 case CHUNK_TYPE_FILL:
224 if (chunk_header->total_sz !=
regards,
dan carpenter
This error path should return -EINVAL instead of success.
Fixes: e261fbf34785 ("blk: host_dev: Sanity check on the size of host backing
file")
Signed-off-by: Dan Carpenter
---
drivers/block/host_dev.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/block/host_dev.c b/dri
This condition has a bitwise & vs logical && typo so it only preserves
odd number error codes.
Fixes: 3b880757abca ("dm: regulator: uclass driver code cleanup")
Signed-off-by: Dan Carpenter
---
drivers/power/regulator/regulator-uclass.c | 2 +-
1 file changed, 1 in
The pmic_reg_read() function can return errors. Add a check for that.
Fixes: 4e8aa0065d4b ("button: qcom-pmic: introduce Qualcomm PMIC button driver")
Signed-off-by: Dan Carpenter
---
This patch is mostly to make static checkers happy but it's obvious and
harmless.
drivers/but
> Signed-off-by: Mike Looijmans
Thanks, Mike.
Fixes: 2141d250f510 ("armv8: fsl-layerscape: bootcmd identification for
TFABOOT")
Reviewed-by: Dan Carpenter
regards,
dan carpenter
phy\n", __func__);
> + return -ENOENT;
> + }
> +
> + return device_bind_driver_to_node(dev, "msm8916_usbphy",
> "msm8916_usbphy",
> + phy_node, NULL);
> +
> + return 0;
Delete the extra return 0.
> +}
regards,
dan carpenter
set core clock rate: %d\n", ret);
> + return -EINVAL;
The if statement looks reversed. Or if we want clk_set_rate() to fail
then there isn't a reason to print "ret" in the error message because
we know that's zero.
> + }
>
> return 0;
> }
regards,
dan carpenter
len += ret;
> - buf += ret;
> + if (is_ofst_odd == 1) {
> + memcpy(buf, (buf + 1), (len - 1));
This needs to be memmove(). memcpy() is undefined for overlapped
buffers.
> + *retlen += (ret - 1);
> + buf += ret - 1;
> + is_ofst_odd = 0;
> + } else {
> + *retlen += ret;
> + buf += ret;
> + }
> from += ret;
> len -= ret;
> }
regards,
dan carpenter
strlen(mbr_parts_p3) +
248 max(strlen(mbr_parts_p4), strlen(mbr_parts_p5)) +
249 strlen(mbr_parts_tail);
250 ut_assertf(sizeof(mbr_parts_buf) >= mbr_parts_max, "Buffer
avail: %ld; buffer req: %ld\n",
251 sizeof(m
g of pre-dtb kernels (3.4 for
> example) since it uses ATAGs. To fix this, pass `-` in the
> fdt extlinux field as a signal that no tree should be used.
Passing - doesn't seem like the most intuitive thing... Is there a
different argument we could use?
regards,
dan carpenter
On Wed, Jan 24, 2024 at 11:27:12AM +0300, Dan Carpenter wrote:
> On Wed, Jan 24, 2024 at 12:19:29PM +0530, MD Danish Anwar wrote:
> > When CONFIG_TI_ICSSG_PRUETH is enabled, add config name check for the
> > icssg2 overlay in board_fit_config_match() API.
> >
> > Sig
nfigs being enabled.
if (IS_ENABLED(CONFIG_TI_ICSSG_PRUETH) &&
strcmp(name, "k3-am654-icssg2") == 0)
return 0;
if (IS_ENABLED(TARGET_AM654_A53_EVM) &&
strcmp(name, "k3-am654-base-board"))
return 0;
return -1;
regards,
dan carpenter
The btrfs_decompress() function mostly (u32)-1 on error but it can
also return -EPERM or other kernel error codes from zstd_decompress().
The "ret" variable is an int, so we could just check for negatives.
Signed-off-by: Dan Carpenter
---
fs/btrfs/inode.c | 4 ++--
1 file changed, 2
aro cares about so if you have static
checker ideas then feel free to email the smatch mailing list.
sma...@vger.kernel.org
regards,
dan carpenter
The x509_cert_parse() and pkcs7_parse_message() functions return error
pointers. They don't return NULL. Update the checks accordingly.
Signed-off-by: Dan Carpenter
---
test/lib/asn1.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/test/lib/asn1.c b/test/lib/a
This should be allocating the memory for "item" instead of "menu".
The item struct is 48 bytes instead of 96 (assuming a 64bit system)
so this saves a little memory.
Signed-off-by: Dan Carpenter
---
boot/scene_menu.c | 2 +-
1 file changed, 1 insertions(+), 1 deletions(-
Match the "=0x" instead of just "=0".
Signed-off-by: Dan Carpenter
---
We sometimes two character partial matching for commands so people can
type "re" instead of "read". But here reading two characters doesn't
seem correct.
cmd/nvedit_efi.c | 2 +
On Wed, Jul 26, 2023 at 06:49:44PM -0600, Simon Glass wrote:
> Hi Dan,
>
> On Tue, 25 Jul 2023 at 09:40, Dan Carpenter wrote:
> >
> > The > comparison needs to be changed to >= to prevent an out of bounds
> > write on th next line.
> >
> > S
ze > UINT_MAX.
>
> [0]
> https://trustedcomputinggroup.org/wp-content/uploads/EFI-Protocol-Specification-rev13-160330final.pdf
I have maybe misread something... I don't think this is a real issue.
32bit systems aren't going to be able to allocate that much memory
anyway. Also there are a lot of size_t parameters already so it's not
a new issue.
regards,
dan carpenter
On Thu, Jul 27, 2023 at 11:28:52AM +0300, Ilias Apalodimas wrote:
> Hi Dan, Heinrich
>
> On Thu, 27 Jul 2023 at 11:25, Heinrich Schuchardt wrote:
> >
> > On 7/27/23 09:16, Dan Carpenter wrote:
> > > The efi_parse_pkcs7_header() function returns NULL on error
On Thu, Jul 27, 2023 at 10:25:55AM +0200, Heinrich Schuchardt wrote:
> On 7/27/23 09:16, Dan Carpenter wrote:
> > The efi_parse_pkcs7_header() function returns NULL on error so the check
> > for IS_ERR() should be changed to a NULL check.
> >
> > Signed-off-by: Dan C
te_bits(priv->regmap, priv->reg_addr,
priv->reg_mask,
63 regval);
64 }
regards,
dan carpenter
The efi_parse_pkcs7_header() function returns NULL on error so the check
for IS_ERR() should be changed to a NULL check.
Signed-off-by: Dan Carpenter
---
lib/efi_loader/efi_capsule.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/lib/efi_loader/efi_capsule.c b/lib
Check for efi_search_protocol() failure before dereferencing "handler"
to avoid a crash.
Signed-off-by: Dan Carpenter
---
lib/efi_loader/efi_load_options.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/efi_loader/efi_load_options.c
b/lib/efi_loader/efi_load
This line break is not done correctly. We don't want to have all those
tabs in the printed output.
Signed-off-by: Dan Carpenter
---
fs/cramfs/cramfs.c | 6 ++
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/fs/cramfs/cramfs.c b/fs/cramfs/cramfs.c
index 6c017ce
The u16_strlcat() is in units of u16 not bytes. So the limit needs to
be ARRAY_SIZE() instead of sizeof().
Signed-off-by: Dan Carpenter
---
test/unicode_ut.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/test/unicode_ut.c b/test/unicode_ut.c
index b27d7116b9ee
These lines are supposed to be indented one more tab. Otherwise it's
confusing to read.
Signed-off-by: Dan Carpenter
---
boot/pxe_utils.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/boot/pxe_utils.c b/boot/pxe_utils.c
index d13c47dd9429..ac1414a5f26d 100644
nging the type of efi_prepare_aligned_image() to a
size_t pointer.
Signed-off-by: Dan Carpenter
---
v2: Change efi_prepare_aligned_image() instead of changing
efi_image_authenticate(). This is a cleaner way to fix the problem.
include/efi_loader.h | 2 +-
lib/efi_loader/efi_image_loa
On Wed, Jul 26, 2023 at 10:11:04AM +0300, Ilias Apalodimas wrote:
> Hi Dan
>
> On Wed, 26 Jul 2023 at 09:55, Dan Carpenter wrote:
> >
> > It's pretty unlikely that anyone is going to be using EFI authentication
> > on a 32bit system. However, if you di
/* If filename and short name are the same, quit. */
140 sprintf(buf, "%.*s.%.3s", period_location, dirent.name,
dirent.ext);
141 if (!strcmp(buf, filename)) {
142 ret = 1;
regards,
dan carpenter
This code has a & vs && typo so it only preserves odd value error
codes and not even value error codes.
Signed-off-by: Dan Carpenter
---
drivers/power/regulator/regulator-uclass.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/power/regulator/regulator
We know that "pa" is non-NULL so it's nicer to just return zero instead
of return !pa. This has no effect on runtime behavior.
Signed-off-by: Dan Carpenter
---
drivers/remoteproc/rproc-uclass.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/r
The "oftree_count" is the number of entries which have been set in
the oftree_list[] array. If all the entries have been initialized then
this off by one would result in reading one element beyond the end
of the array.
Signed-off-by: Dan Carpenter
---
drivers/core/ofnode.c | 2
If btrfs_read_fs_root() fails with -ENOENT, then we go to the next
entry. Fine. But if it fails for a different reason then we need
to clean up and return an error code. In the current code it
doesn't clean up but instead dereferences "root" and crashes.
Signed-off-by: Dan C
The ec_command_inptr() function returns negative error codes or
the number of bytes that it was able to read. The cros_ec_get_sku_id()
function should return negative error codes. Right now it returns
positive error codes or negative byte counts.
Signed-off-by: Dan Carpenter
---
drivers/misc
It's pretty unlikely that anyone is going to be using EFI authentication
on a 32bit system. However, if you did, the efi_prepare_aligned_image()
function would write 8 bytes of data to the &efi_size variable and it
can only hold 4 bytes so that corrupts memory.
Signed-off-by: Dan
ot ideal.
Signed-off-by: Dan Carpenter
---
include/video.h | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/include/video.h b/include/video.h
index 9729fa348aa5..b364bf91825f 100644
--- a/include/video.h
+++ b/include/video.h
@@ -58,7 +58,7 @@ enum video_log2_bpp {
* Conv
This returns the wrong variable. It ends up returning NULL when it was
suppose to return an error pointer.
Signed-off-by: Dan Carpenter
---
cmd/mux.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/cmd/mux.c b/cmd/mux.c
index 833266f08b1e..c75907af7726 100644
--- a/cmd
557 memcpy(resp->data, slot->data, EC_VSTORE_SLOT_SIZE);
558 len = sizeof(*resp);
559 break;
560 }
561 case EC_CMD_PWM_GET_DUTY: {
562 const struct ec_params_pwm_get_duty *req = req_data;
regards,
dan carpenter
The > comparison needs to be changed to >= to prevent an out of bounds
write on th next line.
Signed-off-by: Dan Carpenter
---
lib/addr_map.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/lib/addr_map.c b/lib/addr_map.c
index 9b3e0a544e47..86e932e4b561 100644
---
The parentheses are in the wrong place so this passes the number of
bytes to write as "sizeof(index_0) != TPM_SUCCESS" when just
"sizeof(index_0)" was intended. (1 byte vs 4 bytes).
Signed-off-by: Dan Carpenter
---
cmd/tpm_test.c | 4 ++--
1 file changed, 2 insertions(+),
97 matches
Mail list logo