From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754482AbbLINfv (ORCPT ); Wed, 9 Dec 2015 08:35:51 -0500 Received: from lxorguk.ukuu.org.uk ([81.2.110.251]:42270 "EHLO lxorguk.ukuu.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753317AbbLINfu (ORCPT ); Wed, 9 Dec 2015 08:35:50 -0500 Date: Wed, 9 Dec 2015 13:35:33 +0000 From: One Thousand Gnomes To: Nitin Gupta Cc: Arnd Bergmann , Greg Kroah-Hartman , Shivnandan Kumar , Vidushi Koul , Gaurav Kohli , Rajat Suri , Shailesh Pandey , "shiv.jnumca08@gmail.com" , "linux-kernel@vger.kernel.org" Subject: Re: [PATCH] char:misc minor is overflowing Message-ID: <20151209133533.29040318@lxorguk.ukuu.org.uk> In-Reply-To: <1925385281.482851449665491986.JavaMail.weblogic@epmlwas08d> References: <1925385281.482851449665491986.JavaMail.weblogic@epmlwas08d> Organization: Intel Corporation X-Mailer: Claws Mail 3.12.0 (GTK+ 2.24.28; x86_64-redhat-linux-gnu) 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 Wed, 09 Dec 2015 12:51:33 +0000 (GMT) Nitin Gupta wrote: > Hi, > > Is there any modification / improvement needed in this patch ? > > ------- Original Message ------- > Sender : Shivnandan Kumar Engineer/SRI-Noida-Advance Solutions - System 1 R&D Group/Samsung Electronics > Date : Nov 20, 2015 15:35 (GMT+05:30) > Title : [PATCH] char:misc minor is overflowing > > When a driver register as a misc driver and > it tries to allocate minor number dynamically. > Then there is a chance of minor number overflow. > The problem is that 64(DYNAMIC_MINORS) is not enough If you are allocating more than the odd minor number you shouldn't be using misc devices in the first place but should be using cdev_init/cdev_add/register_chrdev_region and friends. So 64 really should never be "not enough". miscdevice is more historical than useful and really goes back to the days long before all the region allocators existed. Alan