From mboxrd@z Thu Jan 1 00:00:00 1970 From: drozdziak1@gmail.com (Stan Drozd) Date: Tue, 20 Jun 2017 15:31:29 +0200 Subject: My network device don't work In-Reply-To: <186270325-26e3212af6540c227a34d3cd3b5e0c56@pmq3v.m5r2.onet> References: <186270325-26e3212af6540c227a34d3cd3b5e0c56@pmq3v.m5r2.onet> Message-ID: <20170620133128.GB1233@gmail.com> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org On Tue, Jun 20, 2017 at 02:32:31PM +0200, wiktoria.lewicka wrote: > Hello. > I write simple network device, but its don't work. Module is loading, loading, loading... > Code: > [...] Hello, "strncpy(my_netdev.name, DEV_NAME, 5)" only copies the 5 chars in "chwdp" without the null byte. You could bump it to 6 or maybe change 5 to IFNAMSIZ (the net_device.name's size) and then change the last byte to '\0' manually