Commit 3d5a2440 authored by Russell King's avatar Russell King

[ARM] Fix potential oops and kill unused variable warning in sa1111.c

This fixes a potential oops/use after free bug, and removes an unused
variable warning.
parent a063296d
...@@ -589,8 +589,7 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent, ...@@ -589,8 +589,7 @@ sa1111_init_one_child(struct sa1111 *sachip, struct resource *parent,
ret = dmabounce_register_dev(&dev->dev, 1024, 4096); ret = dmabounce_register_dev(&dev->dev, 1024, 4096);
if (ret) { if (ret) {
printk("SA1111: Failed to register %s with dmabounce", dev->dev.bus_id); printk("SA1111: Failed to register %s with dmabounce", dev->dev.bus_id);
kfree(dev); device_unregister(&dev->dev);
device_unregister(dev);
} }
} }
} }
...@@ -779,8 +778,7 @@ int dma_needs_bounce(struct device *dev, dma_addr_t addr, size_t size) ...@@ -779,8 +778,7 @@ int dma_needs_bounce(struct device *dev, dma_addr_t addr, size_t size)
/* /*
* Check to see if either the start or end are illegal. * Check to see if either the start or end are illegal.
*/ */
return ((addr & ~(*dev->dma_mask))) || return ((addr & ~dma_mask)) || ((addr + size - 1) & ~dma_mask);
((addr + size - 1) & ~(*dev->dma_mask));
} }
struct sa1111_save_data { struct sa1111_save_data {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment