mirror of
				https://github.com/torvalds/linux.git
				synced 2025-11-04 10:40:15 +02:00 
			
		
		
		
	switchdev: fix return value of switchdev_port_fdb_dump in case of error
switchdev_port_fdb_dump is used as .ndo_fdb_dump. Its return value is
idx, so we cannot return errval.
Fixes: 45d4122ca7 ("switchdev: add support for fdb add/del/dump via switchdev_port_obj ops.")
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
Acked-by: Sridhar Samudrala <sridhar.samudrala@intel.com>
Acked-by: Scott Feldman<sfeldma@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
			
			
This commit is contained in:
		
							parent
							
								
									b65888796b
								
							
						
					
					
						commit
						0890cf6cb6
					
				
					 1 changed files with 1 additions and 5 deletions
				
			
		| 
						 | 
					@ -853,12 +853,8 @@ int switchdev_port_fdb_dump(struct sk_buff *skb, struct netlink_callback *cb,
 | 
				
			||||||
		.cb = cb,
 | 
							.cb = cb,
 | 
				
			||||||
		.idx = idx,
 | 
							.idx = idx,
 | 
				
			||||||
	};
 | 
						};
 | 
				
			||||||
	int err;
 | 
					 | 
				
			||||||
 | 
					 | 
				
			||||||
	err = switchdev_port_obj_dump(dev, &dump.obj);
 | 
					 | 
				
			||||||
	if (err)
 | 
					 | 
				
			||||||
		return err;
 | 
					 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
						switchdev_port_obj_dump(dev, &dump.obj);
 | 
				
			||||||
	return dump.idx;
 | 
						return dump.idx;
 | 
				
			||||||
}
 | 
					}
 | 
				
			||||||
EXPORT_SYMBOL_GPL(switchdev_port_fdb_dump);
 | 
					EXPORT_SYMBOL_GPL(switchdev_port_fdb_dump);
 | 
				
			||||||
| 
						 | 
					
 | 
				
			||||||
		Loading…
	
		Reference in a new issue