From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752543AbdLLS1S (ORCPT ); Tue, 12 Dec 2017 13:27:18 -0500 Received: from mail-pg0-f50.google.com ([74.125.83.50]:34783 "EHLO mail-pg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752160AbdLLS1P (ORCPT ); Tue, 12 Dec 2017 13:27:15 -0500 X-Google-Smtp-Source: ACJfBotMNXO1ysxQumFbWFv3nwKhR7MSX3nfzbz7FQeqmuGXFYD4rStQbohOey2ltApP7IdV+E+sJQ== Date: Tue, 12 Dec 2017 10:27:12 -0800 From: Stephen Hemminger To: Ma Shimiao Cc: , , Subject: Re: [PATCH] drivers/staging/irda: fix max dup length for kstrndup Message-ID: <20171212102712.40e7a652@xeon-e3> In-Reply-To: <20171212085444.15901-1-mashimiao.fnst@cn.fujitsu.com> References: <20171212085444.15901-1-mashimiao.fnst@cn.fujitsu.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 12 Dec 2017 16:54:44 +0800 Ma Shimiao wrote: > If source string longer than max, kstrndup will alloc max+1 space. > So, we should make sure the result will not over limit. > > Signed-off-by: Ma Shimiao Did you read the TODO file in drivers/staging/irda? The irda code will be removed soon from the kernel tree as it is old and obsolete and broken. Don't worry about fixing up anything here, it's not needed.