Skip to content

Commit

Permalink
memory: emif: Add check for setup_interrupts
Browse files Browse the repository at this point in the history
As the potential failure of the devm_request_threaded_irq(),
it should be better to check the return value of the
setup_interrupts() and return error if fails.

Fixes: 68b4aee ("memory: emif: add interrupt and temperature handling")
Signed-off-by: Jiasheng Jiang <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Krzysztof Kozlowski <[email protected]>
  • Loading branch information
JiangJias authored and krzk committed Mar 4, 2022
1 parent a06bf59 commit fd7bd80
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions drivers/memory/emif.c
Original file line number Diff line number Diff line change
Expand Up @@ -1117,7 +1117,7 @@ static int __init_or_module emif_probe(struct platform_device *pdev)
{
struct emif_data *emif;
struct resource *res;
int irq;
int irq, ret;

if (pdev->dev.of_node)
emif = of_get_memory_device_details(pdev->dev.of_node, &pdev->dev);
Expand Down Expand Up @@ -1147,7 +1147,9 @@ static int __init_or_module emif_probe(struct platform_device *pdev)
emif_onetime_settings(emif);
emif_debugfs_init(emif);
disable_and_clear_all_interrupts(emif);
setup_interrupts(emif, irq);
ret = setup_interrupts(emif, irq);
if (ret)
goto error;

/* One-time actions taken on probing the first device */
if (!emif1) {
Expand Down

0 comments on commit fd7bd80

Please sign in to comment.