• Xiaotian Feng's avatar
    megaraid: fix BUG_ON() from incorrect use of delayed work · c1d390d8
    Xiaotian Feng authored
    megaraid use INIT_WORK to declare a hotplug_work, but cast the
    hotplug_work from work_struct to delayed_work and
    schedule_delayed_work on it.  This is very dangerous, as other part of
    delayed_work might be kernel memories allocated by others.
    
    With commit 8852aac2 ("workqueue: mod_delayed_work_on() shouldn't queue
    timer on 0 delay"), schedule_delayed_work() will check dwork->timer
    before queue_work even when @delay is 0, this causes megaraid code to
    hit the BUG_ON() in workqueue code.  Change megaraid code to use
    delayed work.
    Signed-off-by: default avatarXiaotian Feng <dannyfeng@tencent.com>
    Signed-off-by: default avatarTejun Heo <tj@kernel.org>
    Cc: Neela Syam Kolli <megaraidlinux@lsi.com>
    Cc: "James E.J. Bottomley" <JBottomley@parallels.com>
    Cc: linux-scsi@vger.kernel.org
    c1d390d8
megaraid_sas_base.c 142 KB