mirror of
https://github.com/SCST-project/scst.git
synced 2026-08-18 05:06:31 +00:00
- Switched to a more traditional error handling style with regard to MAD
handler registration: sport->mad_agent is now reset to NULL when MAD handler registration fails. - Fixed bug in srpt_refresh_port(): this function now returns a negative value instead of zero when MAD registration fails. git-svn-id: http://svn.code.sf.net/p/scst/svn/trunk@877 d57e44dd-8a1f-0410-8b47-8ef2f437770f
This commit is contained in:
+5
-2
@@ -465,8 +465,11 @@ static int srpt_refresh_port(struct srpt_port *sport)
|
||||
srpt_mad_send_handler,
|
||||
srpt_mad_recv_handler,
|
||||
sport);
|
||||
if (IS_ERR(sport->mad_agent))
|
||||
if (IS_ERR(sport->mad_agent)) {
|
||||
ret = PTR_ERR(sport->mad_agent);
|
||||
sport->mad_agent = NULL;
|
||||
goto err_query_port;
|
||||
}
|
||||
}
|
||||
|
||||
return 0;
|
||||
@@ -501,7 +504,7 @@ static void srpt_unregister_mad_agent(struct srpt_device *sdev)
|
||||
if (ib_modify_port(sdev->device, i, 0, &port_modify) < 0)
|
||||
printk(KERN_ERR PFX "disabling MAD processing"
|
||||
" failed.\n");
|
||||
if (sport->mad_agent && !IS_ERR(sport->mad_agent)) {
|
||||
if (sport->mad_agent) {
|
||||
ib_unregister_mad_agent(sport->mad_agent);
|
||||
sport->mad_agent = NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user