mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	net: bgmac: Fix return value check for fixed_phy_register()
The fixed_phy_register() function returns error pointers and never
returns NULL. Update the checks accordingly.
Fixes: c25b23b8a3 ("bgmac: register fixed PHY for ARM BCM470X / BCM5301X chipsets")
Signed-off-by: Ruan Jinjie <ruanjinjie@huawei.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Reviewed-by: Leon Romanovsky <leonro@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
			
			
This commit is contained in:
		
							parent
							
								
									a0e026e7b3
								
							
						
					
					
						commit
						23a14488ea
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		| 
						 | 
					@ -1448,7 +1448,7 @@ int bgmac_phy_connect_direct(struct bgmac *bgmac)
 | 
				
			||||||
	int err;
 | 
						int err;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
	phy_dev = fixed_phy_register(PHY_POLL, &fphy_status, NULL);
 | 
						phy_dev = fixed_phy_register(PHY_POLL, &fphy_status, NULL);
 | 
				
			||||||
	if (!phy_dev || IS_ERR(phy_dev)) {
 | 
						if (IS_ERR(phy_dev)) {
 | 
				
			||||||
		dev_err(bgmac->dev, "Failed to register fixed PHY device\n");
 | 
							dev_err(bgmac->dev, "Failed to register fixed PHY device\n");
 | 
				
			||||||
		return -ENODEV;
 | 
							return -ENODEV;
 | 
				
			||||||
	}
 | 
						}
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue