If John Doe commits some tort against Mary Jones, and Bob Smith is uninvolved, but Mary sues both John and Bob (Jones v. Doe and Smith when the suit should just be Jones v. Doe), what happens? She has a legal reason to sue John, but her suing Bob is frivolous.
Can a lawsuit naming multiple defendants be partially dismissed?
Yes. This happens routinely.
As one random example, in a recent 7th Circuit case, there was no doubt that the Plaintiff had stated a legally valid claim against two off-duty Indianapolis officers who choked a bar patron unconscious, dragged him facedown to parking lot, beat him still further, emptied his wallet, and left him covered in blood.
But, the Plaintiff also named the city that employed them in its municipal police department when they were on duty as a defendant. The trial court denied the city's motion to dismiss, and a jury awarded $1.2 million of damages against the city as well.
The 7th Circuit, however, held that the trial court should have dismissed the City that employed them as a defendant, since it did not have legal liability for the off duty conduct of its officers, and the City further purged itself of any claim that it adopted a policy tolerating this conduct when it fired the officers after learning of the incident.
On the other hand, a plaintiff can sue defendants in the alternative and only has to dismiss a defendant when it is clear that no reasonably jury could hold that particular defendant liable.
For example, suppose that a house with a structural carpentry defect was built by two framing contractors. It is clear that the defective work was all done by a single framing contractor and that it was defective, but there aren't good records of which contractor did what work. The Plaintiff can properly sue both framing contractors in the alternative for the damages caused by the defective framing work, and can leave it to the jury to decide on the merits which of the two did the defective work if the question isn't cleared upon unequivocally before then.