]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
In the passthru IOCTL path, the mfi command pool was freely accessible N times
authorKashyap D Desai <kadesai@FreeBSD.org>
Wed, 8 Oct 2014 09:37:47 +0000 (09:37 +0000)
committerKashyap D Desai <kadesai@FreeBSD.org>
Wed, 8 Oct 2014 09:37:47 +0000 (09:37 +0000)
commit839ee02531b5a3f7e52188011c355a6044748de3
tree304dd076f5a5f787f78e0a58aabc950ddb25c66f
parentda011113442d442dcb7c12a70ebba65fd8ff0d77
In the passthru IOCTL path, the mfi command pool was freely accessible N times
where as there are limited number(32) of mfi commands in the pool.
The mfi command pool is now restricted to 27 simultaneous accesses by using
a counting semaphore while calling the passthru function.

In the mrsas_cam.c source file there was a same function name mrsas_poll(),
which was same as the mrsas_poll() implemented in the mrsas.c file for the
polling interface.
To clearly distinguish the functionality by usage we have renamed the former
as mrsas_cam_poll().

In the passthru function let's say it has got an mfi command from the pool
but it has failed in one of the DMA function call which will lead to leak
an mfi command because in the ERROR case it directly returns and not freeing up
the occupied mfi command.

Reviewed by: ambrisko
MFC after: 2 weeks
Sponsored by: AVAGO Technologies
sys/dev/mrsas/mrsas.c
sys/dev/mrsas/mrsas.h
sys/dev/mrsas/mrsas_cam.c
sys/dev/mrsas/mrsas_ioctl.c