Skip to content

Commit

Permalink
powerpc/4xx: Delete error message for a ENOMEM in two functions
Browse files Browse the repository at this point in the history
Omit an extra message for a memory allocation failure in these
functions.

This issue was detected by using the Coccinelle software.

Signed-off-by: Markus Elfring <elfring@users.sourceforge.net>
Signed-off-by: Michael Ellerman <mpe@ellerman.id.au>
  • Loading branch information
Markus Elfring authored and Michael Ellerman committed Dec 21, 2018
1 parent 52930bc commit a8d5dad
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions arch/powerpc/platforms/4xx/ocm.c
Original file line number Diff line number Diff line change
Expand Up @@ -334,7 +334,6 @@ void *ppc4xx_ocm_alloc(phys_addr_t *phys, int size, int align,

ocm_blk = kzalloc(sizeof(*ocm_blk), GFP_KERNEL);
if (!ocm_blk) {
printk(KERN_ERR "PPC4XX OCM: could not allocate ocm block");
rh_free(ocm_reg->rh, offset);
break;
}
Expand Down Expand Up @@ -388,10 +387,8 @@ static int __init ppc4xx_ocm_init(void)
return 0;

ocm_nodes = kzalloc((count * sizeof(struct ocm_info)), GFP_KERNEL);
if (!ocm_nodes) {
printk(KERN_ERR "PPC4XX OCM: failed to allocate OCM nodes!\n");
if (!ocm_nodes)
return -ENOMEM;
}

ocm_count = count;
count = 0;
Expand Down

0 comments on commit a8d5dad

Please sign in to comment.