Stefan Richter wrote: > Tony Battersby wrote: > >> I think BUG_ON is >> the best way to go for this instead of printk/return because bugs >> will be noticed and fixed instead of possibly going unnoticed. >> > ... > >> static void sg_rq_end_io(struct request *rq, int uptodate) >> { >> > ... > >> + int result, resid, done = 1; >> + >> + BUG_ON(srp->done != 0); >> > > AFAIU this is typically called in atomic context. If so, WARN_ON is > preferred. > > Good point. I think the following would be the best way then: if (WARN_ON(srp->done != 0)) return; > ... > >> + BUG_ON(sfp == NULL); >> + >> + sdp = sfp->parentdp; >> > > This would bring up a NULL pointer dereference dump anyway. > Yes, and that would have the same problem as BUG_ON by killing the machine. So I think WARN_ON()/return works best for this too. Tony -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html