[Sound-open-firmware] [PATCH 1/2] rimage: fix wrong error message
From: Pan Xiuli xiuli.pan@linux.intel.com
If keyname can not be open, error message should output keyname insert of tmp path.
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com --- rimage/pkcs1_5.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index 64a4b25..5b93311 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -80,7 +80,8 @@ int pkcs_sign(struct image *image, struct fw_image_manifest *man, fprintf(stdout, " pkcs: signing with key %s\n", image->key_name); fp = fopen(image->key_name, "r"); if (fp == NULL) { - fprintf(stderr, "error: can't open file %s %d\n", path, -errno); + fprintf(stderr, "error: can't open file %s %d\n", + image->key_name, -errno); return -errno; } PEM_read_PrivateKey(fp, &privkey, NULL, NULL);
From: Pan Xiuli xiuli.pan@linux.intel.com
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com --- rimage/css.c | 6 ++++++ 1 file changed, 6 insertions(+)
diff --git a/rimage/css.c b/rimage/css.c index bc69cf1..79b5ace 100644 --- a/rimage/css.c +++ b/rimage/css.c @@ -32,6 +32,12 @@ void ri_css_hdr_create(struct image *image) /* get local time and date */ gettimeofday(&tv, NULL); date = localtime(&tv.tv_sec); + + if (!date) { + fprintf(stderr, "error: cant get localtime %d\n", -errno); + return; + } + date->tm_year += 1900; fprintf(stdout, " css: set build date to %d:%2.2d:%2.2d\n", date->tm_year, date->tm_mon, date->tm_mday);
On Fri, 2018-05-11 at 15:55 +0800, Xiuli Pan wrote:
From: Pan Xiuli xiuli.pan@linux.intel.com
If keyname can not be open, error message should output keyname insert of tmp path.
Signed-off-by: Pan Xiuli xiuli.pan@linux.intel.com
rimage/pkcs1_5.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/rimage/pkcs1_5.c b/rimage/pkcs1_5.c index 64a4b25..5b93311 100644 --- a/rimage/pkcs1_5.c +++ b/rimage/pkcs1_5.c @@ -80,7 +80,8 @@ int pkcs_sign(struct image *image, struct fw_image_manifest *man, fprintf(stdout, " pkcs: signing with key %s\n", image->key_name); fp = fopen(image->key_name, "r"); if (fp == NULL) {
fprintf(stderr, "error: can't open file %s %d\n", path,
-errno);
fprintf(stderr, "error: can't open file %s %d\n",
return -errno; } PEM_read_PrivateKey(fp, &privkey, NULL, NULL);image->key_name, -errno);
Both applied.
Thanks
Liam
participants (2)
-
Liam Girdwood
-
Xiuli Pan