From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755100Ab2IFC1z (ORCPT ); Wed, 5 Sep 2012 22:27:55 -0400 Received: from mga01.intel.com ([192.55.52.88]:29854 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754704Ab2IFC1y (ORCPT ); Wed, 5 Sep 2012 22:27:54 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="4.80,377,1344236400"; d="scan'208";a="218674546" Date: Thu, 6 Sep 2012 10:27:51 +0800 From: Fengguang Wu To: linux-serial@vger.kernel.org Cc: Alan Cox , Jiri Slaby , Greg Kroah-Hartman , LKML Subject: [PATCH] serial_core: fix sizeof(pointer) Message-ID: <20120906022751.GA16285@localhost> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org sizeof when applied to a pointer typed expression gives the size of the pointer. Generated by: scripts/coccinelle/misc/noderef.cocci Signed-off-by: Fengguang Wu --- cocci-output-38612-39d907-serial_core.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/drivers/tty/serial/serial_core.c +++ b/drivers/tty/serial/serial_core.c @@ -640,7 +640,7 @@ static void uart_get_info(struct tty_por { struct uart_port *uport = state->uart_port; - memset(retinfo, 0, sizeof(retinfo)); + memset(retinfo, 0, sizeof(*retinfo)); retinfo->type = uport->type; retinfo->line = uport->line;