diff mbox

[v2,06/19] remoteproc: core: Add explicit message error if cached table failed

Message ID 1472676622-32533-7-git-send-email-loic.pallardy@st.com (mailing list archive)
State Superseded
Headers show

Commit Message

Loic PALLARDY Aug. 31, 2016, 8:50 p.m. UTC
In rproc_fw_boot, add error message if kmemdump failed
as done for other errors.

Signed-off-by: Loic Pallardy <loic.pallardy@wanadoo.fr>
---
 drivers/remoteproc/remoteproc_core.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Lee Jones Sept. 1, 2016, 7:09 a.m. UTC | #1
On Wed, 31 Aug 2016, Loic Pallardy wrote:

> In rproc_fw_boot, add error message if kmemdump failed
> as done for other errors.
> 
> Signed-off-by: Loic Pallardy <loic.pallardy@wanadoo.fr>
> ---
>  drivers/remoteproc/remoteproc_core.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
> index 96bc8c644..3282a4e 100644
> --- a/drivers/remoteproc/remoteproc_core.c
> +++ b/drivers/remoteproc/remoteproc_core.c
> @@ -1139,8 +1139,10 @@ static int rproc_fw_boot(struct rproc *rproc, const struct firmware *fw)
>  	 * cached_table will be copied into device memory.
>  	 */
>  	rproc->cached_table = kmemdup(table, tablesz, GFP_KERNEL);
> -	if (!rproc->cached_table)
> +	if (!rproc->cached_table) {
> +		dev_err(dev, "Failed to create cached table\n");

This is an OOM error message, which are not allowed upstream.

I believe if kmemdup() fails, the OOM handler will inform the user.

>  		goto clean_up;
> +	}
>  
>  	rproc->table_ptr = rproc->cached_table;
>
Loic PALLARDY Sept. 8, 2016, 9:40 a.m. UTC | #2
On 09/01/2016 09:09 AM, Lee Jones wrote:
> On Wed, 31 Aug 2016, Loic Pallardy wrote:
>
>> In rproc_fw_boot, add error message if kmemdump failed
>> as done for other errors.
>>
>> Signed-off-by: Loic Pallardy <loic.pallardy@wanadoo.fr>
>> ---
>>  drivers/remoteproc/remoteproc_core.c | 4 +++-
>>  1 file changed, 3 insertions(+), 1 deletion(-)
>>
>> diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
>> index 96bc8c644..3282a4e 100644
>> --- a/drivers/remoteproc/remoteproc_core.c
>> +++ b/drivers/remoteproc/remoteproc_core.c
>> @@ -1139,8 +1139,10 @@ static int rproc_fw_boot(struct rproc *rproc, const struct firmware *fw)
>>  	 * cached_table will be copied into device memory.
>>  	 */
>>  	rproc->cached_table = kmemdup(table, tablesz, GFP_KERNEL);
>> -	if (!rproc->cached_table)
>> +	if (!rproc->cached_table) {
>> +		dev_err(dev, "Failed to create cached table\n");
>
> This is an OOM error message, which are not allowed upstream.
>
> I believe if kmemdup() fails, the OOM handler will inform the user.

Yes true, I'll drop this patch in v2
Regards,
Loic
>
>>  		goto clean_up;
>> +	}
>>
>>  	rproc->table_ptr = rproc->cached_table;
>>
>
--
To unsubscribe from this list: send the line "unsubscribe linux-remoteproc" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/drivers/remoteproc/remoteproc_core.c b/drivers/remoteproc/remoteproc_core.c
index 96bc8c644..3282a4e 100644
--- a/drivers/remoteproc/remoteproc_core.c
+++ b/drivers/remoteproc/remoteproc_core.c
@@ -1139,8 +1139,10 @@  static int rproc_fw_boot(struct rproc *rproc, const struct firmware *fw)
 	 * cached_table will be copied into device memory.
 	 */
 	rproc->cached_table = kmemdup(table, tablesz, GFP_KERNEL);
-	if (!rproc->cached_table)
+	if (!rproc->cached_table) {
+		dev_err(dev, "Failed to create cached table\n");
 		goto clean_up;
+	}
 
 	rproc->table_ptr = rproc->cached_table;