[2.6 patch] fs/smbfs/request.c: turn NULL dereference into BUG()

From: Adrian Bunk (bunk_at_stusta.de)
Date: 10/31/05

  • Next message: Adrian Bunk: "[-mm patch] DLM must depend on SYSFS"
    Date:	Mon, 31 Oct 2005 12:13:49 +0100
    To: Andrew Morton <akpm@osdl.org>
    
    

    In a case documented as

      We should never be called with any of these states

    BUG() in a case that would later result in a NULL pointer dereference.

    Signed-off-by: Adrian Bunk <bunk@stusta.de>

    ---
    This patch was already sent on:
    - 15 Jul 2005
    - 26 Mar 2005
    --- linux-2.6.12-rc1-mm3-full/fs/smbfs/request.c.old	2005-03-26 13:19:19.000000000 +0100
    +++ linux-2.6.12-rc1-mm3-full/fs/smbfs/request.c	2005-03-26 13:41:30.000000000 +0100
    @@ -786,8 +642,7 @@ int smb_request_recv(struct smb_sb_info 
     		/* We should never be called with any of these states */
     	case SMB_RECV_END:
     	case SMB_RECV_REQUEST:
    -		server->rstate = SMB_RECV_END;
    -		break;
    +		BUG();
     	}
     
     	if (result < 0) {
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Adrian Bunk: "[-mm patch] DLM must depend on SYSFS"

    Relevant Pages

    • RE: kernel BUG at kernel/timer.c:370!
      ... Subject: kernel BUG at kernel/timer.c:370! ... Could you please apply the below patch, wait for the problem to reoccur, ... Please read the FAQ at http://www.tux.org/lkml/ ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: aic7xxx regression occuring after 2.6.12 final
      ... On Sat, 2005-07-02 at 16:42 +0100, Tony Vroon wrote: ... my best guess is that this is a double bug. ... send the line "unsubscribe linux-kernel" in ... Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)
    • Re: [PATCH] PCI: PCI/libata INTx bug fix
      ... > Previous INTx cleanup patch had a bug that was not caught. ... send the line "unsubscribe linux-kernel" in ... Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)
    • Re: 2.6.14-rc2-mm2 (PHY reset until link up)
      ... Dominik Karall wrote: ... > I'm not sure if this bug is in 2.6.14-rc2 too. ... send the line "unsubscribe linux-kernel" in ... Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)
    • [2.6.14-rc4] ipw2200 still filling up dmesg
      ... The bug in bugzilla ... send the line "unsubscribe linux-kernel" in ... Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)