diff mbox series

[1/1] diskpart: ensure diskpart format is enabled if fstype is set

Message ID 20210923103351.88684-1-james.hilliard1@gmail.com
State Accepted
Headers show
Series [1/1] diskpart: ensure diskpart format is enabled if fstype is set | expand

Commit Message

James Hilliard Sept. 23, 2021, 10:33 a.m. UTC
Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
---
 handlers/diskpart_handler.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Stefano Babic Sept. 24, 2021, 9:31 a.m. UTC | #1
On 23.09.21 12:33, James Hilliard wrote:
> Signed-off-by: James Hilliard <james.hilliard1@gmail.com>
> ---
>   handlers/diskpart_handler.c | 6 ++++++
>   1 file changed, 6 insertions(+)
> 
> diff --git a/handlers/diskpart_handler.c b/handlers/diskpart_handler.c
> index d079c8f..ea4d792 100644
> --- a/handlers/diskpart_handler.c
> +++ b/handlers/diskpart_handler.c
> @@ -826,8 +826,14 @@ static int diskpart(struct img_type *img,
>   						strncpy(part->name, equal, sizeof(part->name));
>   						break;
>   					case PART_FSTYPE:
> +#ifdef CONFIG_DISKPART_FORMAT
>   						strncpy(part->fstype, equal, sizeof(part->fstype));
>   						break;
> +#else
> +						ERROR("Partitions have fstype entries but diskpart format support is missing !");
> +						ret = -EINVAL;
> +						goto handler_exit;
> +#endif
>   					case PART_DOSTYPE:
>   						strncpy(part->dostype, equal, sizeof(part->dostype));
>   						hybrid++;
> 

Acked-by : Stefano Babic <sbabic@denx.de>

Best regards,
Stefano Babic
diff mbox series

Patch

diff --git a/handlers/diskpart_handler.c b/handlers/diskpart_handler.c
index d079c8f..ea4d792 100644
--- a/handlers/diskpart_handler.c
+++ b/handlers/diskpart_handler.c
@@ -826,8 +826,14 @@  static int diskpart(struct img_type *img,
 						strncpy(part->name, equal, sizeof(part->name));
 						break;
 					case PART_FSTYPE:
+#ifdef CONFIG_DISKPART_FORMAT
 						strncpy(part->fstype, equal, sizeof(part->fstype));
 						break;
+#else
+						ERROR("Partitions have fstype entries but diskpart format support is missing !");
+						ret = -EINVAL;
+						goto handler_exit;
+#endif
 					case PART_DOSTYPE:
 						strncpy(part->dostype, equal, sizeof(part->dostype));
 						hybrid++;