History

net: seeq: Fix the function used to release some memory in an error handling path

In commit 99cd149efe82 ("sgiseeq: replace use of dma_cache_wback_inv"), a call to 'get_zeroed_page()' has been turned into a call to 'dma_alloc_coherent()'. Only the remove function has been updated to turn the corresponding 'free_page()' into 'dma_free_attrs()'. The error hndling path of the probe function has not been updated. Fix it now. Rename the corresponding label to something more in line.

Christophe JAILLET committed 7 years ago

Commit e1e54ec1 parent dd7078f1 file · +4 −3Browse files

Unified · Split

drivers/net/ethernet/seeq/sgiseeq.c+4−3
@@ -794,15 +794,16 @@ static int sgiseeq_probe(struct platform_device *pdev) · 793 unmodified lines
794794 printk(KERN_ERR "Sgiseeq: Cannot register net device, "
795795 "aborting.\n");
796796 err = -ENODEV;
797− goto err_out_free_page;
797+ goto err_out_free_attrs;
798798 }
799799
800800 printk(KERN_INFO "%s: %s %pM\n", dev->name, sgiseeqstr, dev->dev_addr);
801801
802802 return 0;
803803
804−err_out_free_page:
805− free_page((unsigned long) sp->srings);
804+err_out_free_attrs:
805+ dma_free_attrs(&pdev->dev, sizeof(*sp->srings), sp->srings,
806+ sp->srings_dma, DMA_ATTR_NON_CONSISTENT);
806807 err_out_free_dev:
807808 free_netdev(dev);
808809