Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

esp32s3_partition.c: Appease a compiler warning (-Wdiscarded-qualifiers) #14871

Merged
merged 1 commit into from
Nov 20, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 6 additions & 4 deletions arch/xtensa/src/esp32s3/esp32s3_partition.c
Original file line number Diff line number Diff line change
Expand Up @@ -769,6 +769,8 @@ int esp32s3_partition_init(void)
encrypt = esp32s3_flash_encryption_enabled();
for (i = 0; i < num; i++)
{
char *name;

if (info->magic != PARTITION_MAGIC)
{
break;
Expand Down Expand Up @@ -842,8 +844,8 @@ int esp32s3_partition_init(void)
mtd_priv->mtd.ioctl = esp32s3_part_ioctl;
mtd_priv->mtd.read = esp32s3_part_read;
mtd_priv->mtd.write = esp32s3_part_write;
mtd_priv->mtd.name = strdup(label);
if (!mtd_priv->mtd.name)
mtd_priv->mtd.name = name = strdup(label);
if (!name)
{
ferr("ERROR: Failed to allocate MTD name\n");
kmm_free(mtd_priv);
Expand All @@ -857,7 +859,7 @@ int esp32s3_partition_init(void)
if (!mtd_priv->part_mtd)
{
ferr("ERROR: Failed to create MTD partition\n");
lib_free(mtd_priv->mtd.name);
lib_free(name);
kmm_free(mtd_priv);
ret = -ENOSPC;
goto errout_with_mtd;
Expand All @@ -867,7 +869,7 @@ int esp32s3_partition_init(void)
if (ret < 0)
{
ferr("ERROR: Failed to register MTD @ %s\n", path);
lib_free(mtd_priv->mtd.name);
lib_free(name);
kmm_free(mtd_priv);
goto errout_with_mtd;
}
Expand Down