Skip to content

Commit

Permalink
rockchip: mkimage: fix mkimage -l for header v1
Browse files Browse the repository at this point in the history
There are two paths to reach this function, either through mkimage -l or
through dumpimage -l. The latter passes a NULL imagename while the
former passes an empty string. Therefore, let's make both tools behave
the same by handling the empty string the same way as for NULL.

Without this, the only way to get some information out of mkimage -l is
to provide "-n rk3399" for example, which isn't documented in the usage
of the tool.

Signed-off-by: Quentin Schulz <[email protected]>
Reviewed-by: Kever Yang <[email protected]>
  • Loading branch information
QSchulz authored and keveryang committed Jun 14, 2024
1 parent c924f7e commit 3f9a19b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/rkcommon.c
Original file line number Diff line number Diff line change
Expand Up @@ -470,7 +470,7 @@ int rkcommon_verify_header(unsigned char *buf, int size,
* If no 'imagename' is specified via the commandline (e.g. if this is
* 'dumpimage -l' w/o any further constraints), we accept any spl_info.
*/
if (params->imagename == NULL)
if (params->imagename == NULL || !strlen(params->imagename))
return 0;

/* Match the 'imagename' against the 'spl_hdr' found */
Expand Down

0 comments on commit 3f9a19b

Please sign in to comment.