forked from mirrors/linux
		
	dmaengine: coh901318: Fix a double-lock bug
The function coh901318_alloc_chan_resources() calls spin_lock_irqsave() before calling coh901318_config(). But coh901318_config() calls spin_lock_irqsave() again in its definition, which may cause a double-lock bug. Because coh901318_config() is only called by coh901318_alloc_chan_resources(), the bug fix is to remove the calls to spin-lock and -unlock functions in coh901318_config(). Signed-off-by: Jia-Ju Bai <baijiaju1990@gmail.com> Reviewed-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Vinod Koul <vkoul@kernel.org>
This commit is contained in:
		
							parent
							
								
									651022382c
								
							
						
					
					
						commit
						627469e444
					
				
					 1 changed files with 0 additions and 4 deletions
				
			
		| 
						 | 
					@ -1807,8 +1807,6 @@ static int coh901318_config(struct coh901318_chan *cohc,
 | 
				
			||||||
	int channel = cohc->id;
 | 
						int channel = cohc->id;
 | 
				
			||||||
	void __iomem *virtbase = cohc->base->virtbase;
 | 
						void __iomem *virtbase = cohc->base->virtbase;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	spin_lock_irqsave(&cohc->lock, flags);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	if (param)
 | 
						if (param)
 | 
				
			||||||
		p = param;
 | 
							p = param;
 | 
				
			||||||
	else
 | 
						else
 | 
				
			||||||
| 
						 | 
					@ -1828,8 +1826,6 @@ static int coh901318_config(struct coh901318_chan *cohc,
 | 
				
			||||||
	coh901318_set_conf(cohc, p->config);
 | 
						coh901318_set_conf(cohc, p->config);
 | 
				
			||||||
	coh901318_set_ctrl(cohc, p->ctrl_lli_last);
 | 
						coh901318_set_ctrl(cohc, p->ctrl_lli_last);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	spin_unlock_irqrestore(&cohc->lock, flags);
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	return 0;
 | 
						return 0;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
 | 
					
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue